Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
97
rated 0 times [  99] [ 2]  / answers: 1 / hits: 26929  / 11 Years ago, thu, july 18, 2013, 12:00:00

I have a table that has a column with Yes/No as possible values



<table id=mytable>
<thead>
<tr>
<th>
Col1
</th>
<th>
Col2
</th>

<th>
ActiveYN
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Apple
</td>
<td>
12345
</td>

<td>
Yes
</td>
</tr>
<tr>
<td>
Orange
</td>
<td>
67890
</td>

<td>
No
</td>
</tr>
<tr>
<td>
Mango
</td>
<td>
456745
</td>

<td>
Yes
</td>
</tr>





I need to show the row if ActiveYN is 'Yes' and Hide id ActiveYN is 'No'
How can i access the ActiveYN inside JQuery and show/hide accordingly?


More From » jquery

 Answers
1

DEMO



$('button').on('click', function () {
var $rowsNo = $('#mytable tbody tr').filter(function () {
return $.trim($(this).find('td').eq(2).text()) === No
}).toggle();
});

[#76906] Wednesday, July 17, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tai

Total Points: 466
Total Questions: 87
Total Answers: 116

Location: Saint Helena
Member since Tue, Nov 3, 2020
4 Years ago
;