<ul>
<li>A</li>
</ul>
$("li").click(function(){
console.log("Hello");
});
$("ul").on("click", "li", function(){
console.log("Hello");
});
$("ul").append('<li>B</li>');
Hi everyone, when I press on "A", I have 2 "Hello"-logs in console, and when I press "B", it's only one "Hello", that comes from UL event handler.
Can someone explain that behavior?
Thank you.