JavaScript Reference/Javascript Methods/getElementById — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 11:22, 26 мая 2010
"getElementById()" Example
<source lang="javascript">
<html> <body> <script language="JavaScript"> function function1() {
var m = document.getElementById("myA"); alert(m.innerText);
} </script>
Click in the following element:
<a id="myA"
href="http://www.wbex.ru" onclick="return(false);" onmouseup="function1();">Hyper link to wbex.ru
</a> </body> </html>
</source>
"getElementById()" is applied to
<source lang="javascript">
+----------------+--------------------------------------------------------------+ | Applied_To |document | +----------------+--------------------------------------------------------------+
</source>
"getElementById()" Syntax, Parameters and Note
<source lang="javascript">
Note: Get the element by id.
Syntax:
document.getElementById(param1) Parameters:
param1 Required; the element"s id value. </source>