disable a checkbox once it has been checked - Javascript jQuery

Javascript examples for jQuery:Form Checkbox

Description

disable a checkbox once it has been checked

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.3.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){/*from  ww  w  .  j  a  v  a2 s  . c  om*/
   $('.something').on('click', function() {
        $(this).prop ( "disabled", this.checked );
    });
    });

      </script> 
 </head> 
 <body> 
  <input class="something" type="checkbox" value="1">  
 </body>
</html>

Related Tutorials