How can I Strip all regular html tags except , (>

前端 未结 4 561
误落风尘
误落风尘 2020-12-21 02:29

When a user create a message there is a multibox and this multibox is connected to a design panel which lets users change fonts, color, size etc.. When the message is submit

4条回答
  •  眼角桃花
    2020-12-21 03:14

    Does this do what you want? http://jsfiddle.net/smerny/r7vhd/

    $("body").find("*").not("a,img,br").each(function() {
        $(this).replaceWith(this.innerHTML);
    });
    

    Basically select everything except a, img, br and replace them with their content.

提交回复
热议问题