title: replace textbox with a div with jquery not working
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/12550986/replace-textbox-with-div-with-jquery-not-working">replace textbox with div with jquery not working</a>  </p>
  </blockquote>
  
  
  
  <p><strong>It's just working for a few seconds and then the div disappears again:</strong></p>
  
  <pre><code>$(document).ready(function () {
  
      $("#done").click(function () {
          $('#txtname').replaceWith(function () {
  
              return '&lt;div&gt;' + $(this).val() + '&lt;/div&gt;';
          });
      });
  </code></pre>
  
  <p><strong>.aspx</strong></p>
  
  <pre><code> &lt;asp:TextBox ID="txtname" runat="server" BorderColor="#96A6C5" CssClass="txt"&gt;&lt;/asp:TextBox&gt;&lt;/div&gt;
  
  &lt;div class="text"&gt;
  &lt;asp:Button ID="done" runat="server" onclick="done_Click"/&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>.cs</strong></p>
  
  <pre><code>protected void done_Click(object sender, EventArgs e)
      {
  
      }
  </code></pre>