javascript - How to store previous state of checkboxes in multiple accordians -
i have multiple accordians on page , each accordian has multiple checkboxes in it. want store previous state of checkbox can verify state changed or not. problem cant use event document.ready because in event shows not checkboxes loaded on page because under accordians , loaded when accodian expands , 1 accordian expandable in application. in event have store previous state of checkboxes?
thanks.
assume multiple checkboxes has own unique id
or value
you want store state
respect id
or value
you can use .map() checked box.
var store; var storechecked = function() { store = $('input:checkbox:checked').map(function () { return [this.id,this.checked]; }).get(); };
see demo here: jsfiddle
Comments
Post a Comment