Name

target — NN 4 IE n/a DOM n/a

Synopsis

Read-only

Reference to the element object that is the intended destination of the current event. This property is convenient in switch constructions for an event handler function that handles the same event type for a number of different elements.

Example

switch (evtObj.target.name) {
    case "myButton":
        ...
    ...
}

Value

Object reference.

Default

None.

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.