I am using JQuery, and would like to hide rows in a table depending on the value of one of its cells.
I have the following table:
<tr class="tr-class">
<td class="status">
<span class="status_submitted">submitted</span>
</td>
</tr>
<tr class="tr-class">
<td class="status">
<span class="status_approved">approved</span>
</td>
</tr>
I also have the following functions, where I can hide/show the <tr>.
function showSubmitted() {
$(".tr-class").show();
}
function hideSubmitted() {
$(".tr-class").hide();
}
But this hides/shows all the rows.
Question
How do I conditionally hide/show the rows?
For example, function hideSubmitted() should just hide the rows where the status cell is submitted.
JSFiddle https://jsfiddle.net/31c90zbv/1/