javascript - Select all checkboxes issue(jQuery) -
javascript - Select all checkboxes issue(jQuery) -
i have little issue, if select single checkbox , press f5 state of checbox remain(so checked) if utilize jquery select checkboxes on page , press f5 of checkboxes blank(so uncheck, one's handpicked remain in there state). how can solve this, when nail refresh remain same?
the code
jquery('.sellectall').click(function(){ $('input:checkbox').attr('checked',true); });
i assume you're using jquery 1.6 or later.
if so, utilize prop()[docs] method instead of attr()[docs] method.
then should same behavior if user clicked box.
jquery('.sellectall').click(function(){ $('input:checkbox').prop('checked',true); }); ...or set checked property manually:
jquery('.sellectall').click(function(){ $('input:checkbox').each(function() { this.checked = true; }); }); javascript jquery forms checkbox
Comments
Post a Comment