Disable the action of check-uncheck a checkbox - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Checkbox

Description

Disable the action of check-uncheck a checkbox

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){// w  ww .j  a v  a 2 s.  co m
document.querySelector("#check").addEventListener("click", function(e) {
  e.preventDefault();
});
    }

      </script> 
   </head> 
   <body> 
      <input type="checkbox" id="check">  
   </body>
</html>

Related Tutorials