title: Hide button in asp.net formview using jquery
body: <p>I want to hide a button control inside a <code>FormView</code> trough <code>JQuery</code>.
  The form section is defined in this way:</p>
  
  <pre><code>&lt;body&gt;
  &lt;div id="main"&gt;
      &lt;form id="_frmMain" runat="server"&gt;
          &lt;div id="contenitore"&gt;
              &lt;asp:FormView
                  ID="_fvMain"
                  runat="server"
                  DefaultMode="Edit"
                  Width="100%"&gt;
                  &lt;EditItemTemplate&gt;
                      &lt;asp:Table CssClass="sub" runat="server"&gt;
                          &lt;asp:TableRow CssClass="tr_button_list"&gt;
                              &lt;asp:TableCell ColumnSpan="3"&gt;
                                  &lt;asp:Button
                                      ID="_btnOk"
                                      ClientIDMode="Static"
                                      Text="Ok"
                                      runat="server"
                                      CssClass="butt_orange_small" 
                                      OnClientClick="javascript: return ShowSection('section1');" /&gt;
                              &lt;asp:Button
                                      ID="_btnCancel"
                                      ClientIDMode="Static"
                                      Text="Cancel"
                                      runat="server"
                                      CssClass="butt_orange_small" 
                                      OnClientClick="javascript: return ShowSection('section2');" /&gt;
  </code></pre>
  
  <p>I use this code:</p>
  
  <pre><code>$(function () {
      var _btnOk = $("#_btnOk");
  
       _btnOk.hide();
  });
  </code></pre>
  
  <p>but it's not working. If I debug this script I found the <code>hidden</code> property of the <code>_btnOk</code> object to remain false even after the <code>.hide()</code> call.</p>
  
  <p>BTW I cannot hide the button using the class reference since it will hide <code>_btnCancel</code> also and I need this to remain visibile.</p>