How To Replace < with> with > using jquery

前端 未结 10 779
鱼传尺愫
鱼传尺愫 2020-12-13 20:14

I have a page that is part of a backend CRM admin panel. On that page the HTML output comes from some PHP functions that I can\'t access. And that HTML automatically changes

10条回答
  •  失恋的感觉
    2020-12-13 21:14

    The simplest thing to do would be

    $('#test').each(function(){
        var $this = $(this);
        var t = $this.text();
        $this.html(t.replace('<','<').replace('>', '>'));
    });
    

    working edit/jsfiddle by Jared Farrish

提交回复
热议问题