Disable checkbox - Javascript jQuery

Javascript examples for jQuery:Form Checkbox

Description

Disable 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" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){// w  w  w  .  j  a  v  a  2 s . co  m
$('.listen').click( function() {
    $('.listen').attr('disabled', true);
});
    });

      </script> 
 </head> 
 <body> 
  <input type="checkbox" id="cb1" class="listen"> cb1 
  <br> 
  <input type="checkbox" id="cb2" class="listen"> cb2  
 </body>
</html>

Related Tutorials