Home | Top | Free Ajax Editor | JavaScript Editor | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |
Retrieves a collection of objects based on the value of the NAME attribute.
Syntax
collObjects = document .getElementsByName( sNameValue )Parameters
sNameValue | Required. String that specifies the value of a NAME attribute. |
Return Value
Returns a collection of objects with the same NAME attribute value.
Remarks
When you use the getElementsByName method, all elements in the document that have the specified NAME or ID attribute value are returned.
Elements that support both the NAME and the ID attribute are included in the collection returned by the getElementsByName method, but not elements with a NAME expando .
Example
This example uses the getElementsByName method to return a collection of input type=text elements with the specified NAME attribute value, firstName .
<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. |