I have to following HTML:
<ul class="ulclass">
<li class="liclass">
...some more nesting
<a href="somelink">somelink</a>
....close nesting
</li>
<li class="liclass">
...
</ul>
There is a click event on each li from the class "liclass", so I stop the bubbling from the anchor with (presumably <div>
is inside of .liclass):
$(".liclass div").delegate("a", "click", function(e) {
e.stopPropagation();
});
Now I add more <li class="liclass">
with Ajax .load. The stopPropagation works for the static ".liclass" but not for the dynamically added.
Assume that the code for <ul class="ulclass">
is there when the page is loaded.
Can you please let me know how the change .delegate in order to stop the bubbling for the dynamically added .liclass.