Once I change element's class using jQuery, the click function does not work on the new class.
Here is my code
jQuery('.close').on('click', function() {
jQuery('div').slideUp();
jQuery(this).addClass('open');
jQuery(this).removeClass('close');
});
jQuery('.open').on('click', function() {
jQuery('div').slideDown();
jQuery(this).addClass('close');
jQuery(this).removeClass('open');
});
You can try it here - http://jsfiddle.net/NkG9k/1/
Try clicking on the toggle button again. (it won't slidedown the div)