implementing a reset button to get previous state of checkboxes checked attr
Hello I am new to jquery and need to implement a reset button to set the value of a list of checkboxes in a table back to the prevous state.
I try to store the original state of each box e.g:
$myvar = $("#myvar input[type=checkbox]:checked")
$myvar.data("defaultValue", $myvar) or $(#myvar).data("defaultValue, $myvar);
When I hit the reset button I want to set the checkbox check attr to the previous state from the stored in the default
$(#myvar)[0].checked = $(#myvar).data("defaultValue")[0].checked; but it blows
I guess my issue is that I am trying to store an attr in a value var. Please help