I have created a editor using div with content editable true and used a placeholder created by CSS. This works fine in all browser but Firefox.
Following is the code in html and css
HTML -
<div contenteditable="true" data-placeholder="in case this div is empty"></div>
CSS -
div{
padding:5px;
margin: 1em;
border:1px solid gray;
}
div:empty:before {
content: attr(data-placeholder);
color: gray;
}
If we run above code in Firefox (I am using version 27) and click inside content editable div 2-3 times then cursor changes its position and I cannot write anything inside div. However, if we click outside div and again click inside div I get focus successfully and we can write in it. Please help how to fix this.