Это должно быть сделано, при условии, что, когда вы сказали «строка», вы имели в виду <tr>
, а не <td>
:
$(document).ready(function() {
$('td', '#options').filter(function() { // select all the TDs
return $(this).text() == 'Designers'; // keep the ones that have
// 'Designers' as their HTML
}).each(function() { // loop through each of the ones that matched
$(this).closest('tr').hide(); // find the parent tr and hide it
});
});
Если вы просто хотите скрыть фактическое <td>
(которое является не строкой, а ячейкой), вы должны сделать это:
$(document).ready(function() {
$('td', '#options').filter(function() { // select all the TDs
return $(this).text() == 'Designers'; // keep the ones that have
// 'Designers' as their HTML
}).hide();
});
Сокрытие ячеек стола сомнительно, хотя ...