Skip to content Skip to sidebar Skip to footer

How To Get Value Of Checkbox In Table?

How can I get value of checkbox in table? I want use it for in this case in order get parameter. Now, please see html table:

Solution 1:

What you have done is right, but you are not outputting it to the table!

var table = $("#div_func");
var value_check = "";
for (var i = 1; i < table.rows.length; i++) {
    if ($('#chk')[i].is(':checked')) {
        value_check += i + ": " + $('#chk')[i].val();
    }
}
alert(value_check);

And you aren't appending it, instead saving!


Solution 2:

Try to this

 $('#div_func tbody tr  input:checkbox').each(function() {
    if (this.checked) {
        //Do something
    }
});.

Post a Comment for "How To Get Value Of Checkbox In Table?"