title: How do I wrap a span around a section of text in javascript?
body: <p>I have markup like this:</p>
  
  <pre><code>&lt;p&gt;one two three four&lt;/p&gt;
  </code></pre>
  
  <p>And I want to use javascript to convert it to this:</p>
  
  <pre><code>&lt;p&gt;one &lt;span&gt;two three&lt;span&gt; four&lt;/p&gt;
  </code></pre>
  
  <p>I have the offset and length of the section I want to wrap in a span, in this case <code>offset = 4</code> and <code>length = 9</code>. If using jQuery can make it easier, that is preferable.</p>