Removing specific element from a list with JQuery

前端 未结 4 605
迷失自我
迷失自我 2021-02-14 10:35

i have a dynamic list, which looks like this:

  • Text1
  • Text2<
4条回答
  •  野的像风
    2021-02-14 10:43

    You must have an error somewhere else, because what you have just works.

    Please check your error console.

    Although your second example should be:

    $('ul').find('#tl_2').remove(); // but this isn't really needed since we are selecting by id. So just go for the first example which is faster.
    

提交回复
热议问题