[jQuery]HTML, table, tr, hide, show

  • 4641
  • 0

摘要:[jQuery]HTML, table, tr, hide, show

將要動態隱藏或是顯示的tr取一個class名稱


<table>
    <tr class="trhidedate">
                        <td align="right" nowrap="nowrap">
                            <asp:Label ID="lblQAvoDate" runat="server" Text="現金結存旬報日期(傳票日期)" 
                                SkinID="lbl-notnull"/>
                        </td>
                        <td nowrap="nowrap">
                            <asp:TextBox ID="txtQAvoSDate" runat="server" SkinID="textbox-date" />~
                            <asp:TextBox ID="txtQAvoEDate" runat="server" SkinID="textbox-date" />
                        </td>
                    </tr>
                    <tr class="trhideyearno">
                        <td align="right" nowrap="nowrap">年度</td>
                        <td nowrap="nowrap">
                        <asp:TextBox ID="txtQRptYear" runat="server" SkinID="textbox-none" />
                        </td>
                    </tr>
</table>

然後下語法jQuery隱藏或是顯示即可


  $(".trhidedate").hide();
                    $(".trhideyearno").show();