Get the text of nth TD with all tr having particular class
jquery, jquery-ui
Solution
Try this
$('tr.warning').each(function(){
alert($(this).find('td').eq(1).text());
});
Demo Here
Problem
The code which i am working on is as follows: ``` <table> <tr class="warning"> <td> 1 </td> <td> name </td> <td> address </td> <td> phone no </td> <td> Location </td> </tr> <tr> <td> 3 </td> <td> name2 </td> <td> address2 </td> <td> phone no2 </td> <td> Location2 </td> </tr> <tr class="warning"> <td> 6 </td> <td> name5 </td> <td> address5 </td> <td> phone no5 </td> <td> Location5 </td> </tr> <tr> <td> 7 </td> <td> name6 </td> <td> address6 </td> <td> phone no6 </td> <td> Location6 </td> </tr> ``` I like to get the text of all second TD with all tr with class warning. I have tried using _.each method but wasn't succesful