Hi this is a jquery
question:
supposed i have this:
try something like this, you don't need to iterate
$(document).ready(function () {
$("#submit").click(function(){
if($(".select").is(':checked')){
alert($(".select:checked").attr('id'));
}
});
});
Are you only checking one checkbox at a time?
alert( $(".select:checked").attr('id') );
Or, if you have multiple checkboxes checked at once:
$(".select:checked").each(function(){
alert($(this).attr('id'));
});
Demo: http://jsfiddle.net/UTux2/