JavaScript Reference/Javascript Methods/getElementsByName
Версия от 21:30, 25 мая 2010; (обсуждение)
"getElementsByName()" Example
<source lang="javascript">
<html> <body> <script language="JavaScript"> function function1() {
var m = document.getElementsByName("myE"); alert(m.length);
} </script> <a id="myE"
href="http://www.wbex.ru" onclick="return(false);">
This is a link </a>
This is a div element
This is a p element
<input type="button"
value="Get the number of elements that have the same name" onClick="function1();">
This is a table element |
</body> </html>
</source>
"getElementsByName()" is applied to
<source lang="javascript">
+----------------+--------------------------------------------------------------+ | Applied_To |document | +----------------+--------------------------------------------------------------+
</source>
"getElementsByName()" Syntax, Parameters and Note
<source lang="javascript">
Note: Get element by name.
Syntax:
document.getElementsByName(param1) Parameters:
param1 Required; the element"s name or id attribute value. </source>