- JavaScript DHTML
- Javascript Objects
- document
Active Element
<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>
Related examples in the same category