If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Avoid nesting elements in content editable div

I have been facing a problem in inserting content at current cursor position in a content editable div.Step 1 : i insert a span element containing some text .Now i try to insert another element adjacent to the span element.The newly inserted element is getting neseted inside the span element.I want it to get inserted after the span element.
Here is the function that i am using to insert content..