Javascript examples for DOM HTML Element:Form Event
Handle Input field Focus Event trigger and action handler
<html> <head> <script> function myFunction() {/*from www . ja va2s. c o m*/ var isFocused = "It worked!"; document.getElementById("message").innerHTML = isFocused; } </script> </head> <body> <div id="message"> empty string </div> <input type="text" onfocus="myFunction()"> </body> </html>