
Determining which object fired event from event handler.
IE
http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/...
http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/obj...
NS
http://www.mozilla.org/docs/dom/domref/dom_event_ref24.html
http://www.mozilla.org/docs/dom/domref/dom_event_ref.html
--
If we knew what it was we were doing, it would not be called research, would
it? -Albert Einstein
=-=-=
Steve
-=-=-
Quote:
> Greetings,
> Please see if you can help me with this one:
> //I create an img element
> var o = document.createElement("img");
> //Then I assign an event handler it's onclick event
> o.onclick = itemClicked;
> //And finally, I append the new element to the body
> document.body.appendChild(o);
> This all works very fine. My problem is this:
> Suppose I add another img element, and assign that ones onclick event to the
> same event handler. How will I be able to determine which object has been
> clicked?
> function itemClicked()
> {
> alert("How do I know which object has been clicked from here?");
> }
> I need to get this to work in both IE5+ and NS6+.
> Grateful for any help!
> --
> Thanks
> /Billy