jQuery Removing specific text from an element

后端 未结 4 842
谎友^
谎友^ 2020-12-02 23:10

I want to remove the text \"By:\" from an element in my website. I want the rest of the text to remain there. How can I achieve that with jQuery? Thank you.

The HTML

4条回答
  •  盖世英雄少女心
    2020-12-02 23:47

    give an unique id to div, t:

    $('#div_id').html($('#div_id').html().substring(3));
    

    fiddle : http://jsfiddle.net/ChUB4/

提交回复
热议问题