search

Home  >  Q&A  >  body text

javascript - How to remove tags in Baidu ueditor

Baidu's ueditor will automatically add P tags to the content. How to remove it? Nothing you can find online

滿天的星座滿天的星座2747 days ago627

reply all(2)I'll reply

  • 世界只因有你

    世界只因有你2017-05-19 10:22:44

    Use jq, if you want to remove them all:

    $("p").each(function(){
        var xx=$(this).html();
        $(this).replaceWith(xx);
     })

    reply
    0
  • 阿神

    阿神2017-05-19 10:22:44

    There is a corresponding method to obtain plain text: ueditor.getContentTxt()

    The demo shows commonly used methods.

    reply
    0
  • Cancelreply