Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
i have a table .each row has 8 colum.but in some rows 8th column contain a div having Id FoodTypeID .i want to select all such rows using jquery plz help
Posted

JavaScript
$('table').find('tr').filter(function(index) {
    return $('td#FoodTypeID', this).length === 1;
});
 
Share this answer
 
JavaScript
var $trs =  $('#YourTableName tr:has("#FoodTypeID")');
            $trs.css('background-color', 'red');
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900