I have a problem regarding how I will limit my checkbox to the default. for example, I have 7 flags. and I want to limit it to the three flags checked by default after the page loads.
this should be the output: Checkbox1 : true Checkbox2 : true Checkbox3 : true Checkbox4 : false Checkbox5 : false Checkbox6 : false Checkbox7 : false
Here is my sample code:
var mvp = 3; $(document).ready(function() { $("input:checkbox").each(function( index ) { ($this).attr("checked",true); }); });
I mean this, I donβt know where I will put my counter (mvp) inside each of my functions. In this code all my flags are checked: D.
Sorry for the newbies question, please help me ..
source share