asp.net.ph

Skip Navigation Links

getElementById Method

DHTML Methods


DOM Level 2 Specification.

Retrieves the element with the given id.

Syntax

objELement = document.getElementById ( elementID ) 
Parameters

elementID String specifying the unique id value of the element to find.

Return Value

Returns the matching element.

Remarks

If no such element exists, returns null. Behavior is not defined if more than one element has this ID.

Note that the DOM implementation must have information that says which attributes are of type ID. Attributes with the name "ID" are not of type ID unless so defined. Implementations that do not know whether attributes are of type ID or not are expected to return null.

See Also

getElementsByTagName



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note