Child's event is not fired when parent's HTML is changed

ali1

New Member
Here's an example http://jsbin.com/ukoqud/3/editIf you click on a red box, you'll get an alert.If you click on a link, everything in a blue box will be replaced with just a red box. Link will disappear and if you click on a red box then, you'll get no alert.[*]Why this happens?[*]Is it related to innerHTML?[*]Does it work the same way in all browsers?Here's one more example http://jsbin.com/ukoqud/1/edit In this one you'll get an alert after clicking on a link. Things happen in a quite similar way, but result is different.I would like to understand the reason, there's no need to fix my code.
 
Back
Top