Opposite of append in jquery

后端 未结 6 1046
难免孤独
难免孤独 2021-01-31 07:05

I use .append to add to a div

$(this).append(\'
  • test
\');

how can I search for a

6条回答
  •  无人及你
    2021-01-31 07:34

    just had the same problem and ive come across this - which actually does the trick for me:

    // $("#the_div").contents().remove();
    // or short: 
    $("#the_div").empty();
    $("#the_div").append("HTML goes in here...");
    

提交回复
热议问题