JavaScript Reference/Javascript Properties/activeElement
Версия от 18:30, 25 мая 2010; (обсуждение)
"activeElement" Example
<html>
<body onLoad="myButton.focus();">
<input type="Button" id="myButton" value="Element 1" onClick="function1();">
<script language="JavaScript">
function function1() {
var m = document.activeElement.value;
alert("The active element is "+m);
}
</script>
</body>
</html>
"activeElement" is applied to
+----------------+--------------------------------------------------------------+
| Applied_To |document |
+----------------+--------------------------------------------------------------+
"activeElement" Syntax and Note
Note:
Read-only property.
Get the element that has focus, if the document is fully loaded.
Syntax:
document.activeElement