Remove spans before inserting content

In IE8 and below the content seems to get inserted into the spans and therefore is removed when the spans are removed. This fix removes the spans before inserting the new word.