title: Jquery 'html' function Vanilla JS without jQuery
body: <p>I have a jQuery function that I want to create with basic javascript (Vanilla) and am having troubles.</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;&lt;/title&gt;
          &lt;style&gt;#cube1{margin-top:35px;width:305px;height:255px;border:1px solid;}&lt;/style&gt;
          &lt;script src='http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js'&gt;&lt;/script&gt;
          &lt;script&gt;
              function create(){
                  var ad  = "&lt;scr"+"ipt type='text/javascript'&gt;";
                  ad += "alert('boom');";
                  ad += "&lt;/scr"+"ipt&gt;";
                  $('#cube1').html(ad);
              }
          &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id='cube1' onclick='create()'&gt;Create&lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I want to remove jquery.</p>
  
  <p>I want to create a new javascript function that I can pass the <code>&lt;div/&gt;</code> <code>#cube1</code> and the string variable <code>ad</code>.</p>
  
  <p>The function will insert the string content into the <code>&lt;div/&gt;</code> and/or run the script - basically it needs to do the same thing jQuery's <code>html()</code> function does.</p>
  
  <p>This does not work:</p>
  
  <pre><code>document.getElementById( 'cube1' ).innerHTML = ad;
  </code></pre>
  
  <p>I need it to run the script (the alert).</p>
  
  <p>Any help is greatly appreciated!</p>