Selection ranges in webkit (Safari/Chrome)
I'm using a content-editable iframe to create a syntax-highlighter in javascript and one of the most important things is to be able to indent code properly. The following code works just as it should in Firefox: // Create one indent character var range = window.getSelection().getRangeAt(0); var newTextNode = document.createTextNode(Language.tabChar); range.insertNode(newTextNode); range.setStartAfter(newTextNode); It creates a tab char and moves the cursor to the right side of the character. In Chrome and Safari a character is inserted but the cursor won't move to the right of it. I inspected