I have a simle html
div
with a variable number of input checkboxes and i whould like to chek which chekbox is cheked and which isn't
HTML code:
<div>
<input type="checkbox" val="1"/>Check One<br/>
<input type="checkbox" val="2" checked="checked"/>Check Two<br/>
</div>
Javascript code:
var $kids = $("div").children("input");
for (var i = 0; i < $kids.length; i ++) {
// if i alert($kids[i]); i get [object HTMLInputElement] how can i work with it?
alert ($kids[i].val()); // doesn't work
}
In jQuery site i read children()
method can "Get a set of elements containing all of the unique immediate children of each of the matched set of elements." but what is a "set of elements"and how can I work with it?