I have a few checkboxes (some already checked through html checked attribute) on a page and a submit button. I wanna use jquery to run a function using the $.each() loop such that it performs the function if the checkbox is checked, but only if it wasn’t already checked. Also, I want to perform a function for each un checked check box, but only if it was already Checked.
Please help
One way of doing this is to use
.data()to store the original value of the checkbox.
http://jsfiddle.net/8g3uz/3/
Original solution that checks for user interaction rather than change: http://jsfiddle.net/8g3uz/1/