Element object
Represents an element in an HTML or XML document.
![]() |
DOM Information
Inheritance Hierarchy
Members
The Element object has these types of members:
Events
The Element object has these events.
| Event | Description |
|---|---|
| ariarequest |
Fired when an ARIA property is requested via script. |
| command |
Fired whenever a user interface (UI) action takes place. |
| gotpointercapture |
Dispatched prior to the dispatch of the first event after pointer capture is set for a pointer. |
| lostpointercapture |
Dispatched after pointer capture is released for a pointer. |
| MSPointerHover |
Event that is triggered when a contact (normally a pen) moves over an element without touching the surface. |
| ontouchcancel |
Event indicating that the touch point has been canceled/disrupted. |
| ontouchend |
Event indicating that the touch point has ceased to exist. |
| ontouchmove |
Event indicating that the touch point has moved along the touch surface. |
| ontouchstart |
Event indicating that the user has touched the surface of a touch capable device. |
| pointercancel |
Dispatched when either (1) the system has determined that a pointer is unlikely to continue to produce events (for example, due to a hardware event), or (2) after having fired the pointerdown event, the pointer is subsequently used to manipulate the page viewport (for example, panning or zooming). |
| pointerdown |
Dispatched when a pointer enters the state of having a non-zero value for the buttons property. |
| pointerenter |
Dispatched when a pointing device is moved into the hit test boundaries of an element or one of its descendants, including as a result of a pointerdown event from a device that does not support hover. |
| pointerleave |
Dispatched when a pointing device is moved outside of the hit test boundaries of an element or one of its descendants, including as a result of a pointerdown event from a device that does not support hover. |
| pointermove |
Dispatched when a pointer changes coordinates, button state, pressure, tilt, or contact geometry (for example, width and height). |
| pointerout |
Dispatched when any of the following occurs:
|
| pointerover |
Dispatched when a pointing device is moved into the hit test boundaries of an element. Also dispatched prior to a pointerdown event for devices that do not support hover. |
| pointerup |
Dispatched when a pointer leaves the state of having a non-zero value for the buttons property. |
Methods
The Element object has these methods.
| Method | Description |
|---|---|
| msGetRegionContent |
Returns an array of Range instances corresponding to the content from the region flow that is positioned in the region. |
| msZoomTo |
Scrolls and/or zooms an element to its specified coordinate with animation. |
| releasePointerCapture |
Releases a pointer captured by an element (using the setPointerCapture method). |
| requestFullscreen |
Request that the browser display an element in full-screen mode. |
| setPointerCapture |
Assigns a specified pointer to an element. This method is used to ensure that an element continues to receive pointer events even if the contact moves off the element. |
Properties
The Element object has these properties.
| Property | Access type | Description |
|---|---|---|
|
Read/write |
Specifies the content zoom factor. | |
|
Read-only |
Determines if content fully fits into the region or not. | |
|
Provides a way to declare that an accelerator key has been assigned to an element. |
Remarks
The Element interface represents an element in an HTML or XML document. Elements may have attributes associated with them; since the Element interface inherits from Node, the generic Node interface attribute attributes may be used to retrieve the set of all attributes for an element. There are methods on the Element interface to retrieve either an attribute object by name or an attribute value by name. In XML, where an attribute value may contain entity references, an attribute object should be retrieved to examine the possibly fairly complex sub-tree representing the attribute value. On the other hand, in HTML, where all attributes have simple string values, methods to directly access an attribute value can safely be used as a convenience.
See also
