Posted By

Sullan on 12/10/10


Tagged

jquery


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

AllKnightAccess
thisisrogerflanagan
SpoodyGoon
jillella


Toggle Checkbox function


 / Published in: jQuery
 

  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  

You need to login to post a comment.