title: Remove and add a row with a server side control to a table using Jquery
body: <p>I have a row which has a server side control. Depending on a condition I need to remove the row completely, so that the HTML cannot be read by screen-readers and re-added later when the condition is changed. </p>
  
  <p>here is the code i am trying but it is not working</p>
  
  <p>my original ASPX</p>
  
  <pre><code>    table id="tblmain" width="100%"&gt;
          &lt;tr&gt;
              &lt;td valign="top"&gt;
                  &lt;div id="studysub_animal" runat="server"&gt;
                      &lt;h3&gt;
                       Select the vALUE.&lt;/h3&gt;
                      &lt;asp:RadioButtonList  ID="rdb_one" runat="server"&gt;
                          &lt;asp:ListItem Value="Humans"&gt;Humans&lt;/asp:ListItem&gt;
                          &lt;asp:ListItem Value="Non-Human primates"&gt;Non-Human primates&lt;/asp:ListItem&gt;                            
                      &lt;/asp:RadioButtonList&gt;
                  &lt;/div&gt;
              &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr id="tr_optional"&gt;
              &lt;td&gt;
  
                      &lt;h3&gt; Select your second value&lt;/h3&gt;
                      &lt;asp:RadioButtonList ID="rdb_two" runat="server"&gt;
                          &lt;asp:ListItem&gt;Individuals&lt;/asp:ListItem&gt;
                          &lt;asp:ListItem&gt;Population&lt;/asp:ListItem&gt;
                      &lt;/asp:RadioButtonList&gt;
  
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  </code></pre>
  
  <p>This is the jquery i am writing</p>
  
  <pre><code>     $('#&lt;%=rdb_one.ClientID%&gt; input:radio').click(function () {
  
                  var currentIdone = 'Humans';
                  var currentId = $(this).val();
                  var row = $('#tr_optional');
                  if (currentId == currentIdone) {
                      if ($('#tr_studypopul').length) {
  
                      }
                      else {
  
                          $('#tblstudysub_animal').append(row);
                      }
  
                  }
                  else {
                      $('#tr_studypopul').detach();
  
                  }
  
              });
  </code></pre>
  
  <p>any idea. how can i add and remove the row conditioanlly.
  When the page first loads it loads the row it is only hidden or visible depending on the answer </p>