i have a dynamic list, which looks like this:
- Text1
- Text2<
You probably had some silly mistake, it should work:
$('#buttonId').click(function(){
$('#tl_2').remove();
});
Note that there is no need to "find" for element by id. id is unique.
$('li').find('tl_1').remove(); // And you were missing the # anyway...
Make sure you have only one element for each id
. id is like id... You can have only one with the same value.
Each id value must be used only once within a document. If more than one element has been assigned the same ID, queries that use that ID will only select the first matched element in the DOM. This behavior should not be relied on, however; a document with more than one element using the same ID is invalid.