Read some other things on here re: this similar problem but am not sure how to apply this to my dilemma.
I have a jquery function that replaces some HTML in a list.. For example, before the function runs:
<ul id="mylist">
<li id="item1">blah blah blah</li>
<li id="item2">blah blah blah</li>
<li id="item3">blah blah blah</li>
</ul>
Then I have another which runs on click of the LI e.g:
$("#mylist li").click(function () {
alert($(this).attr("id"));
});
Works fine until I dynamically modify the #mylist html, where the alert is blank.
How can I replace the #mylist html and still be able to select the li's found within?