Javascript examples for DOM HTML Element:Input Text
Unfocus/focus a textbox
<html> <head></head> <body> Name: /*w ww . j ava 2s . c o m*/ <input type="text" id="myText"> <p>Click the button to unfocus the text field.</p> <button onclick="myFunction()">Unfocus input</button> <script> document.getElementById("myText").focus(); function myFunction() { document.getElementById("myText").disabled = true; document.getElementById("myText").disabled = false; } </script> </body> </html>