How to disable checkbox in JavaScript

{0 Comments}

You can disable checkbox in JavaScript similarly like you disable textbox in JavaScript. All you have to get the id of the checkbox then set the disable property to true as we done in case of textbox so syntax will be as follows 

 Javascript |  copy code |? 
1
<script type="text/javascript">
2
       function disable() {
3
           document.getElementById( "CheckboxID" ).disabled = 'true';
4
       }
5
 
6
        </script>
7

Leave a Comment

Your email address will not be published.