title: How to add this html in a div, escaping the quotes?
body: <p>I have some html code that i want to add dynamically to a div in a page.</p>
  
  <p>My div is:</p>
  
  <pre><code>&lt;div id="my_div" class="my_class"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>This is my html code that i want to add to the above div, when i click on some button, using jquery onclick event.</p>
  
  <pre><code>&lt;div id="content"&gt;
  'Hello world 123' &lt;br&gt;
  &lt;img src='player.gif' width='200' height='100'&gt;
  Good morning...
  Have a nice day...
  &lt;/div&gt;
  </code></pre>
  
  <p>So far, i tried this general way, when onclick event is invoked:</p>
  
  <pre><code>document.getElementById("my_div").innerHTML = 
  '&lt;div id="content"&gt;
      'Hello world 123' &lt;br&gt;
      &lt;img src='player.gif' width='200' height='100'&gt;
      Good morning...
      Have a nice day...
      &lt;/div&gt;';
  </code></pre>
  
  <p>But as you can see, the code is error prone, as the quotes are mismatched and it breaks. How can i escape the quotes and add the content to div efficiently?</p>