title: How to replace the inner HTML of a <div> tag?
body: <p>My code is as below:</p>
  
  <pre><code>&lt;td style="background-color:#ffffff; padding:40px 22px; font-family:Arial, Helvetica, sans-serif; color:#505050; font-size:12px; font-weight:normal;" id='mydiv'&gt;
  
          [[NEWSLETTER_BODY]]
  
          &lt;/td&gt;
  
  &lt;input type="button" name="btn_preview" id="btn_preview" value="{$preview_value}" class="submit" id="preview_newsletter" onclick="get_text_area_value()"&gt;
  
  &lt;script language="javascript" type="text/javascript"&gt;
  function get_text_area_value() {    
    var email_body = jQuery("textarea#newsletter_email_body").val();
    //alert(email_body);
    $("#mydiv").html ='';
    $("#mydiv").html = email_body;
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>I'm not getting the new value in id "mydiv" but when I print it in alert it displays there. Can you help me in this regard to replace the div's value? Thanks in advance.</p>