Event.target (Property)

A property containing a reference to the object that the event was directed at.


DOM level - 2
JavaScript - 1.2
Netscape - 4.0
Opera - 5.0
Property/method value type:EventTarget object
JavaScript syntax:NmyEvent.target

You can construct an event handler that is shared amongst several target objects in Netscape. If that is the case, this property allows you to determine which one the event was aimed at, so that you can modify the event handler behavior accordingly.

DOM level 2 introduces the EventTarget object as a standard property, so it should be expected to be available more widely in due course than in the Netscape browser.

The version of the targetproperty available in Netscape 4 is significantly different to the target property available in Netscape 6. Whereas the version in Netscape 6 is complient with the DOM, you can only get a handle to the target property in Netscape, 4 via layers.

See also:Event.srcElement, MutationEvent.initMutationEvent()

Property attributes: