1

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. How can I.

thanks in advance

3 Answers 3

1

You can use something like

var tooltipTexts = $("#tableid input:checkbox.GridCheckBox").map(function(){
    return $(this).attr("title");
}).get().join(',');

See a working demo

Sign up to request clarification or add additional context in comments.

1 Comment

Hw to get only the checked list ?
0

Assuming that your tooltip text is in the title attribute of the checkbox, then you do the following:

var tooltips = [];

$(function(){
    $(".GridCheckBox").each(function(){
        tooltips.push($(this).attr("title"));
    });
});

1 Comment

Hw to get only the checked list ?
0

You can iterate over it using .each and then use Array.join() to make it a string.

Here's a fiddle : http://jsfiddle.net/dHCZt/

var titles = [];
$('.GridCheckBox').each(function() {
    if ($(this).attr('title')) {
        titles.push($(this).attr('title'));
    }
});

console.log(titles);
console.log(titles.join(','));

3 Comments

Hw to get only the checked list
@techonthenet just add :checked at the end of the selector .gridCheckBox:checked
@JhonP I tried this one and not working var titles = []; $('#ListGrid .GridCheckBox:checked').each(function() { if ($(this).attr('title')) { titles.push($(this).attr('title')); } });

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.