title: Ie doesnt like range
body: <p>I have a WYSIWYG editor working in all browsers except IE (all versions). I have a problem with the function below:</p>
  
  <pre><code>function tag(tag) {
      var range = window.frames['textEditor'].getSelection().getRangeAt(0);
      var newNode = document.createElement(tag);
      range.surroundContents(newNode);
  }
  </code></pre>
  
  <p>Any ideas on how to fix this?</p>