I am using this code to hide the element in sixth column of a table on a condition (I mean if text of span fourth column of table is “0”).
But this code just works for first row of table.
How can i do this function for all rows of target table ?
if ($('#table tr td:eq(4) > span').text() == "0") {
$('#table tr td:eq(6) > .PrintReport').hide();
}
If you could post the full HTML structure of
trthen you’d get more optimized solutions. Looking at your existing code you could do something like this:Notice that inside the loop I’m using
thisas the context in the selectors.EDIT: Explaining some of the above code –