Why can't I show / hide Html TR using jquery?

I have the following TRin HTML and I use jQuery

<tr class="RowDiv" id="tempTR" runat="server" visible="false">                    <td>
                    <div class="LabelDiv">
                        <div class="dfltTxtBld">
                            ID<span class="reqChar" runat="server" id="Span1" visible="false">
                                *</span>
                        </div>
                    </div>
                </td>
                <td>
                    <div class="InputDiv">
                        <asp:TextBox ID="TextBox1" runat="server" CssClass="txtField" MaxLength="10"></asp:TextBox>
                    </div>
                </td>
                <td>
                    <div id="Div1" runat="server">
                    </div>
                </td>
            </tr>

and in javascript code i called the following method to hide it

$('#<%= tempTR.ClientID %>').hide();

but always this does not even affect the attempt to make it hidden, and then show that it does not work either. I try to hide and show TextBox1, and it works, but if I try with a string, it will not work ... is there a way to show / hide TR?

+3
source share
5 answers

I think you have the same problem as in this post JQuery.Show () does not work with server-side management?

+1

,

$(document).ready(function(){
    $('#tempTR').hide();
});

, - ?

+1

, asp, , HTML.

HTML , $('#<%= tempTR.ClientID %>').hide(); $('#tempTR').hide(); HTML.

ASP , , $('#tempTR.ClientID'), DOM.

0

, TR, , :

$('#other').click(function() {
    $(this).closest("tr").hide();
});

:

$('#other').click(function() {
   $(this).closest("tr").fadeOut('slow');
});

onready

$(document).ready(function($) {
  // Code using $ as usual goes here.
});
0

JQuery javascript. id. .

0
source

Source: https://habr.com/ru/post/1763308/


All Articles