HTML DOM getElementsByName() Method
Complete Document Object Reference
Definition and Usage
The getElementsByName() method returns a collection of objects with the specified NAME.
Syntax
document.getElementsByName(name)
|
Example
<html>
<head>
<script type="text/javascript">
function getElements()
{
var x=document.getElementsByName("myInput");
alert(x.length);
}
</script>
</head>
<body>
<input name="myInput" type="text" size="20" /><br />
<input name="myInput" type="text" size="20" /><br />
<input name="myInput" type="text" size="20" /><br />
<br />
<input type="button" onclick="getElements()"
value="How many elements named 'myInput'?" />
</body>
</html>
|
Try-It-Yourself Demos
Use getElementsByName()
Complete Document Object Reference
 |

|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|