each function with td element
Hi All,
I am having list of checkboxes inside to the <td id = "left"> as sample below,
-
<td id = "left">
<div><input id="0" name="0" type="checkbox" value="true" /><input name="0" type="checkbox" /> Self Referral</div>
<div><input id="10001" name="10001" type="checkbox" value="true" /><input name="10001" type="checkbox" /> Cheng-Hsung Liao Dental Corporation</div>
</td>
<input type = "button" id = "btnAssign" value = "Assign" />
Now In button click i need get the id of all the checkboxes which are checked. for that i wrote jquery like below but i am not getting the result.
-
$(document).ready(function() {
$("#btnAssign").click(function() {
var result = "";
alert($("#left :checked").size());
alert("message 0");
debugger
$("#dv : checked").each(function() {
result = result + $(this).val() + ", ";
});
alert(result);
});
});
please give me a suggestion to make the above code work.
Thanks.