title: Jquery: How to clear an element before appending new content?
body: <p>This is my jquery code</p>
  
  <pre><code> $.ajax({
     url: "PopUpProductDetails.aspx",
              cache: false
       }).done(function (html) {
       $("#dialog").append(html);
   });
  </code></pre>
  
  <p>The first time, it works just fine. It display the content of the <strong>PopUpProductDetails.aspx</strong> page. But, after that, If I click again, I get twice the same content, and so forth. I believe the problem is that I need to clear the <strong>dialog</strong> element first, before appending new content. </p>
  
  <p>How do I do that?</p>