Toggle Checkbox function


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $(document).ready(function() {
  2. $('input#offer').change(function () {
  3. if ($(this).attr("checked")) {
  4. //do the stuff that you would do when 'checked'
  5. $('p').addClass('bold');
  6. return;
  7. }
  8. //Here do the stuff you want to do when 'unchecked'
  9. $('p').removeClass('bold');
  10. });

Report this snippet


Comments


You need to login to view comments.