title: How to replace font tags with span?
body: <p>I'm trying to replace all instances of a font
  tag that has a color attribute like this:</p>
  
  <pre><code>&lt;font color="red"&gt;Some text&lt;/font&gt;
  </code></pre>
  
  <p>with this:</p>
  
  <pre><code>&lt;span style="color: red;"&gt;Some text&lt;/span&gt;
  </code></pre>
  
  <p>I did some hunting on StackOverflow and found this link, and modeled my code after it:
  <a href="https://stackoverflow.com/questions/21478950/javascript-jquery-replace-tags">Javascript JQuery replace tags</a></p>
  
  <p>I've created a little jQuery loop below that is supposed to do the following:</p>
  
  <ol>
  <li>Go through the string(contents of a div)</li>
  <li>Get the font color attribute</li>
  <li>Replace the  tags with a </li>
  <li>Set a CSS style attribute with the appropriate color.</li>
  </ol>
  
  <p>Right now, it doesn't work.  I just get an error stating that 'replaceWith' is not a function.</p>
  
  <pre><code>$('font').each(function () {
      var color;
      this.$('font').replaceWith(function () {
          color = this.attr("color");
          return $('&lt;span&gt;').append($(this).contents());
      });
      this.$("span").attr("style", "color=" + color);
  });
  </code></pre>
  
  <p>Any help would be greatly appreciated!</p>