I’ve been following a guide on expandable rows and now I’d like to know what row has been clicked in my table.
The table has this format:
Parent
--child
--child
Parent
etc.
When a child row is clicked, I’d like to know what text is in the cell (only the text, not the html or more information). How do I retrieve that data?
$(function() {
$('tr[class^=child-]')
.css("cursor","pointer")
.attr("title","Click for more info")
.click(function(){
//Get row cell text (perhaps use $(this)?
});
});
Try simply using
$(this).find('td:first').text()if I understand your question correctly.