SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a div that is part of a custom web part. Once a user clicks an edit-button I want the div to turn into a rich text field to allow the user to edit the contents as they would edit any rich text field in a page.

Currently I'm able to create the rich text field using:


But when the user tries to insert an ordered or unordered list (or apply indentation) from the ribbon the dom breaks. The rich text editor element is moved up two nodes in the hierarchy and some of the surrounding dom nodes are duplicated.

How can I fix this?

share|improve this question
up vote 0 down vote accepted

It seems I have to have an empty div below the div that will become a rich text editor field.

If my dom looks like this:

<div class="editorContainer">

And I call:


I get the behaviour described in the comment above. However if I insert an additional div in the html like so:

<div class="editorContainer">

It works fine. Why it would be required I don't know and I couldn't find any documentation on it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.