Opposite of append in jquery

后端 未结 6 1097
难免孤独
难免孤独 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:21

    What you also should consider, is keeping a reference to the created element, then you can easily remove it specificly:

       var newUL = $('
    • test
    '); $(this).append(newUL); // Later ... newUL.remove();

提交回复
热议问题