jeudi 6 août 2015

How can I make a certain row appear even after reload using jquery?

My jquery seems to be working fine. But every time the page refreshes, "row1" just disappears. But the checkbox is still checked.

How can I make "row1" appear even after reload? Thank you

  $(document).ready(function() {
        $("#chk1").click(function() {
          if ($(this).is(':checked')) {
            $("#row1").show();
          } else {
            $("#row1").hide();
            $('#tbshow').val("");
          }
        });
<script src="http://ift.tt/1oMJErh"></script>
<label for="chk1">
  <input type="checkbox" id="chk1" value="1" runat="server" clientidmode="Static" />Show
</label>

<asp:TableRow ID="row1" runat="server" Style="display: none" ClientIDMode="Static">
  <asp:TableCell>
    <asp:Label ID="lblshow" runat="server" Text="Show">
    </asp:Label>
  </asp:TableCell>
  <asp:TableCell>
    <asp:TextBox ID="tbshow" runat="server" ClientIDMode="Static"></asp:TextBox>
  </asp:TableCell>
</asp:TableRow>



Aucun commentaire:

Enregistrer un commentaire