Javascript examples for DOM HTML Element:Input Number
Input Number disabled Property - Disable and enable a number field
<!DOCTYPE html> <html> <body> <input type="number" id="myNumber" value="2"><br><br> <button onclick="disableBtn()">Disable Number Field</button> <button onclick="enableBtn()">Enable Number Field</button> <script> function disableBtn() {//from w w w . j a v a 2s . c o m document.getElementById("myNumber").disabled = true; } function enableBtn() { document.getElementById("myNumber").disabled = false; } </script> </body> </html>