JQuery:表行显示/隐藏基于列值

Sri*_*vas 7 javascript asp.net jquery jquery-ui razor

我有一个表,其中包含可能值为Yes/No的列

<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>
Run Code Online (Sandbox Code Playgroud)

我需要显示行,如果ActiveYN是'是'并且隐藏id ActiveYN是'否'我怎样才能访问JQuery中的ActiveYN并相应地显示/隐藏?

A. *_*lff 10

DEMO

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