Results 261 - 280 of 1,243

Element.hasAttribute()

The Element.hasAttribute() method returns a Boolean value indicating whether the specified element has the specified attribute or not.
API DOM Element Method Reference

Element.matches()

The Element.matches() method returns true if the element would be selected by the specified selector string; otherwise, returns false.
API DOM Element Method Reference

Event

The Event interface represents any event of the DOM. It contains common properties and methods to any event.
API DOM Event Interface Reference

Comparison of Event Targets

It's easy to get confused about which target to examine when writing an event handler. This article should clarify the use of the target properties.
DOM Gecko NeedsContent NeedsExample NeedsHelp

Event.currentTarget

Identifies the current target for the event, as the event traverses the DOM. It always refers to the element the event handler has been attached to as opposed to event.target which identifies the element on which the event occurred.
API DOM Gecko NeedsBrowserCompatibility Property

Event()

The Event() constructor creates a new Event.
API Constructor DOM Event Reference

Event.eventPhase

Indicates which phase of the event flow is currently being evaluated.
API DOM Gecko Property Reference

DOM on-event handlers

The Web platform provides several ways to get notified of DOM events.  Two common styles are: the generalized addEventListener() and a set of specific on-event handlers. This page focuses on the details of how the latter work.
beginner Beginner DOM NeedsBeginnerUpdate NeedsUpdate

EventTarget.addEventListener()

The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on. The event target may be an Element in a document, the Document itself, a Window, or any other object that supports events (such as XMLHttpRequest).
API DOM EventTarget Method Reference

GlobalEventHandlers.onclose

An event handler for close events sent to the window. (Not available with Firefox 2 or Safari)
API HTML DOM Property Reference

GlobalEventHandlers.ondblclick

The ondblclick property returns the onDblClick event handler code on the current element.
API HTML DOM Property Reference

GlobalEventHandlers.onerror

An event handler for the error event. Error events are fired at various targets for different kinds of errors:
API HTML DOM Property Reference

GlobalEventHandlers.onfocus

The onfocus property returns the onFocus event handler code on the current element.
API HTML DOM Property Reference

GlobalEventHandlers.oninput

An event handler for the input event on the window. The input event is raised when an <input> element value changes. 
API HTML DOM Property Reference

GlobalEventHandlers.onkeydown

The onkeydown property returns the onKeyDown event handler code on the current element.
API HTML DOM Property Reference