This is a code with jQuery 1.7:
<div class="test">
<div class="bu">
<a>
bu here
</a>
</div>
</div>
<script src="http://code.jquery.com/jquery-1.7.js"></script>
<script>
$(document).on('click', '.test', function () { alert(0); return false; });
$(document).on('click', '.bu', function () { alert(1); return false; });
$(document).on('click', '.bu', function () { alert(2); return false; });
</script>
Xlicking on .test > .bu will alert “1” and alert “2”, but not alerts “0”
My question is: how to do the same WITHOUT jQuery (on native DOM API)? Seems, I can’t do it with Native DOM API without implementing my own library…
1 Answer