Removing specific element from a list with JQuery

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

i have a dynamic list, which looks like this:

  • Text1
  • Text2<
4条回答
  •  不思量自难忘°
    2021-02-14 10:56

    I think you are not showing us some part of your code as i suspect you are trying to generate that id dynamically, meaning u set it dynamically as well. you have to make sure that there is no 'space' character within the id which will likely mess thing up...

    $('#tl_2').remove();
    

    Works according to jquery documentation. it worked for me.

提交回复
热议问题