surroundHTML Problem
2006/05/03 19:48
Viewed 6520 times
Replies: 0/0

Love the editor (as do most!).

I have created a number of my own buttons/functions and am running into a problem with surroundHTML().
After calling this function once, then calling it a second time with different values, the HTML is inserted into the body of the document, not the htmlarea editor object.
The html is inserted at the top of my page.

If, after the first "insert", I click on the editor, then call surroundHTML() again, all is fine.

Example: Two new buttons... 1. editor.surroundHTML('<p class=one>','</p>') 2. editor.surroundHTML('<p class=two>','</p>')
If I click on button 1, then button 2, without clicking inside the editor in between, the second call is inserted at the top of the web page.

Any suggestions would help tremendously.

Google