title: Insert an element before another element using ID or CLASSNAME
body: <p>How to move an element before another element? Like example shown below, I need move #child before <code>#parent</code>. There are already some <code>div</code>s exist before and after the #parent, so <code>append</code> and <code>prepend</code> won't work. After and before only take strings. However, the parent and child both have a lot content so I can't just copy them to JavaScript. </p>
  
  <pre><code>&lt;div id="container"&gt;
    //many other existing divs 
  
    &lt;div id="parent"&gt;
       &lt;div id="child"&gt;&lt;/div&gt;
    &lt;/div&gt;
  
    //many other existing divs
  &lt;/div&gt;
  </code></pre>