Javascript examples for DOM HTML Element:Input Text
Input Text disabled Property - Disable and enable a text field:
<!DOCTYPE html> <html> <body> First Name: <input type="text" id="myText" value="Mickey"><br> <button onclick="disableTxt()">Disable Text field</button> <button onclick="enableTxt()">Enable Text field</button> <script> function disableTxt() {//from w w w .j a v a 2 s. c o m document.getElementById("myText").disabled = true; } function enableTxt() { document.getElementById("myText").disabled = false; } </script> </body> </html>