If I write :
<div class="wrapper">
<div>
<input type="text" class="xxx"/>
</div>
<div>
<input type="text" class="yyy"/>
</div>
</div>
question :
when I write: $(".wrapper").on("click",".yyy",function () {}); :
Does it also listen ( and ignores) the .xxx events ?
or is it just listen to the .wrapper and filters all non ".yyy" elements events?
It binds the click event to
.wrapperand if the target was.yyy, it will execute the function. This allows you to remove/replace.yyyat any time, via ajax or whatever, and keep the bound event.