title: Splitting node content in JavaScript DOM
body: <p>I have a scenario where I need to split a node up to a given ancestor, e.g.</p>
  
  <pre><code>&lt;strong&gt;hi there, how &lt;em&gt;are &lt;span&gt;you&lt;/span&gt; doing&lt;/em&gt; today?&lt;/strong&gt;
  </code></pre>
  
  <p>needs to be split into:</p>
  
  <pre><code>&lt;strong&gt;hi there, how &lt;em&gt;are &lt;span&gt;y&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;strong&gt;&lt;em&gt;&lt;span&gt;ou&lt;/span&gt; doing&lt;/em&gt; today?&lt;/strong&gt;
  </code></pre>
  
  <p>How would I go about doing this?</p>