15 January, 2009

jQuery Check Boxes all Checked Values from Div

Something super awesome with jQuery. The ability to get all the values of checkboxes that are checked within a specific div.

//divid is your unique DIV id
$("#divId input:checked").each(function(){
alert($(this).val());
});

As simple as that! We get all the checked ckeckbxes from divId and then alert each of their values. Just remember to leave a space between the divId and input.
Enjoy

No comments: