Home | Top | Web development | JavaScript Editor | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |
Retrieves an object or a collection from the specified collection.
Syntax
oItem = object.namedItem( sName )Parameters
sName | Required. String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made. |
Return Value
Returns an object or a collection of objects if successful, or null otherwise.
Remarks
This method first searches for an object with a matching id attribute. If a match is not found, the method then searches for an object with a matching name attribute, but only on those elements that are allowed a name attribute.
Example
The following example shows how to use the namedItem method to retrieve a div and change its innerText property.
<DIV id="oDIV1">This text will not change.</DIV>Standards Information
This method is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 .
Applies To
|
all , anchors , applets , areas , boundElements , cells , elements , embeds , forms , images , links , mimeTypes , options , plugins , rows , scripts , tBodies , FORM , filters , frames , imports , styleSheets , TextRange , TextRectangle |
Home | Top | Web development | JavaScript Editor | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |