HTML DOM getElementsByName() method
Document Object
Definition and Usage
The getElementsByName() method returns a collection of objects with the specified name.
Syntax
document.getElementsByName(
name
)
| Parameters | Description |
|---|---|
| name | Required. The name of the element. |
Browser support





All major browsers support the getElementsByName() method.
Example
Example
Pop up the number of elements with the specified name:
Try it »
Document Object