Home | Top | Free Ajax Editor | JavaScript Editor | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |
Returns a reference to the first object with the specified value of the ID attribute.
Syntax
oElement = document .getElementById( sIDValue )Parameters
sIDValue | Required. String that specifies the value of an ID attribute. |
Return Value
Returns the first object with the same ID attribute as the specified value.
Remarks
If the ID value belongs to a collection, the getElementById method returns the first object in the collection.
Example
This example uses the getElementById method to return the first occurrence of the ID attribute value, oDiv .
<SCRIPT>Standards Information
This method is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 .
Applies To
|
document |
Home | Top | Free Ajax Editor | JavaScript Editor | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |