title: removing contents of div using Jquery "empty" doesn't work
body: <p>I'm trying to remove contents of particular div which are basically list items and a heading by using jquery empty so that I could replace with new contents. What happens when I run the code is, the whole div element blinked and flash the replaced content and then the old one reappear. Can anyone tell me what am I doing wrong? Here's an excerpt of my code -</p>
  
  <pre><code>$("#msg_tab").bind("click",function(){
    $("#sidebar1").remove(); 
    var html=".....";
    $("#sidebar1").append(html);
   });
  
  
  
  &lt;div id="sidebar1" class="sidebar"&gt;
     &lt;ul&gt;
      &lt;li&gt;
       &lt;h2&gt;Messages&lt;/h2&gt;
       &lt;ul&gt;
        &lt;li&gt;&lt;a href="#"&gt;Compose New Message&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#"&gt;Inbox&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#"&gt;Outbox&lt;/a&gt;&lt;/li&gt;      
        &lt;li&gt;&lt;a href="#"&gt;Unread&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#"&gt;Archive&lt;/a&gt;&lt;/li&gt;
       &lt;/ul&gt;
      &lt;/li&gt;
     &lt;/ul&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>Another question is, how do I write multiple line html code string in javascript so that java would recognize as a string value? Placing forward slash at the end is ok when the string is not a html code but, in html code, I can't figure out how to escape forward slash from ending tags.I've tried escaping it with backward slash but doesn't work. I would be appreciated if anyone could shed a light on this matter as well.</p>