In a div, I have some checkbox. I\'d like when I push a button get all the name of all check box checked. Could you tell me how to do this ?
You can try this...
$(document).ready(function() {
$("button").click(function(){
var checkBoxValues = [];
$.each($("input[name='check_name']:checked"), function(){
checkBoxValues.push($(this).val());
});
console.log(checkBoxValues);
});
});
Not tested but should work:
$("#MyDiv td input:checked").each(function()
{
alert($(this).attr("id"));
});