In the book that talk about the ability of the father object to capture the event of the sun and to detect it.
They used in the object event and event.srcElement.type and event.srcElement.name, I tried and it worked for me.
Can someone know about good source in the internet that explain about the event object and srcElement etc etc
See, at first, this pages from Peter-Paul Koch about events...
Here's an example:
Look at the hierarchy of this snippet, it looks kind of like this
<a href="#" id="anchor1">Click Me</a>
<a href="#" id="anchor2">Click Me</a>
If I was to mouseover anchor2, sibling and parent (and anything above them) would also receive the event object.
You can stop an event object from bubbling up the tree using certain methods like returning false in a callback or using the .stopPropagation() method (https://developer.mozilla.org/en/DOM...topPropagation) which, quite literally, stops the event from propagating up the tree.
Hopefully that sheds some light on it for you. Great question by the way, it's great to know how DOM events actually work - makes trouble shooting a lot easier than if you just started using them without understanding them.
I've switched careers...
I'm NO LONGER a scientist,
but now a web developer...
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread