title: How to write into div using javascript
body: <p>I want to make a for example content variable in javascript which will have a html tags inside with certain values.
  How can I put that in the div when button is pressed.</p>
  
  <p>For example :</p>
  
  <p>This is a content which I want to use: </p>
  
  <pre><code>var contentString = '&lt;div id="info"&gt;'+
  '&lt;h2&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Info:&lt;/b&gt;&lt;/h2&gt;'+
  '&lt;div id="bodyContent"&gt;'+ 
  '&lt;div style=width:220px;display:inline-block;&gt;'+
  '&lt;p&gt;&amp;nbsp; Name: '+ this.name + '&lt;/p&gt;' +
  '&lt;p&gt;&amp;nbsp; Last name: '+ this.last+ '&lt;/p&gt;' +
  '&lt;p&gt;&amp;nbsp; 
  '&lt;/div&gt;'+
  '&lt;/div&gt;'+
  '&lt;/div&gt;'+
  '&lt;/form&gt;';
  </code></pre>
  
  <p>And I want to put it into : <code>&lt;div id=something"&gt;&lt;/div&gt;</code>
  In javascript I can have something like:</p>
  
  <pre><code>$("#button").on('click', function() {
  // What to put in here?
  });
  </code></pre>