Javascript examples for DOM HTML Element:Input Checkbox
Input Checkbox disabled Property - Find out if a checkbox is disabled or not:
<!DOCTYPE html> <html> <body> Checkbox: <input type="checkbox" id="myCheck"> <button onclick="disable()">Disable checkbox</button> <button onclick="undisable()">Enable checkbox</button> <script> function disable() {//ww w .j av a 2s . co m document.getElementById("myCheck").disabled = true; var v = document.getElementById("myCheck").disabled; console.log(v); } function undisable() { document.getElementById("myCheck").disabled = false; var v = document.getElementById("myCheck").disabled; console.log(v); } </script> </body> </html>