Javascript examples for DOM HTML Element:Input Checkbox
The Input object represents an HTML <input> element with type="checkbox".
You can access an <input> element with type="checkbox" by using getElementById():
<!DOCTYPE html> <html> <body> Checkbox: <input type="checkbox" id="myCheck"> <button onclick="myFunction()">Test</button> <script> function myFunction() {//from w w w.j av a2s . co m var x = document.getElementById("myCheck"); x.checked = true; x.disabled = true; } </script> </body> </html>