Wednesday 1 May 2013

How to get values from an html table column of a selected row using javascript


$('tr').click(function() {
    $('tr').removeClass('selected');
    $(this).addClass('selected');

    var td = $(this).children('td');
    for (var i = 0; i < td.length; ++i) {
        alert(i + ': ' + td[i].innerText);
    }
});


Run demo here: http://jsfiddle.net/VjkML/

Another Reference Link Click Me

No comments:

Post a Comment