Let me start by saying, I hate javascript I am trying to create an exceptionally simple/ lite text editor and dont want the complexity of FCKeditor etc. Looking on the net I have found http://pastebin.parentnode.org/78 which is a fairly good piece of code and seems to work well in most cases. The one issue I have found is that if you black out a section of text and then click the button (or what ever the trigger is for the item is) it will replace the blacked out text with the quoted text. What I want to do however is add the text to the start and the end of the selection... can anyone help with what needs to be changed?