I have table with check boxes in it.and the CSS for the check box is GridCheckBox, I want to read the check boxes tool tip into an array with , separated.
I am using this function. But this not getting the checked items. but getting the unchecked items correctly.
This works well
var titles = [];
$('#ListGrid .GridCheckBox').each(function() {
if ($(this).attr('title')) {
titles.push($(this).attr('title'));
}
});
And this not working(Checked items)
var titles = [];
$('#ListGrid .GridCheckBox:checked').each(function() {
if ($(this).attr('title')) {
titles.push($(this).attr('title'));
}
});
Of cos it doesn’t work. The class “.GridCheckBox” u applied on is on the parent “span” and not the “checkbox input” itself!
you can do this though:
assuming one span.GridCheckBox contains only one checkbox input.