The <div>
tag below has a contentEditable
attribute set to true
, as follows: contentEditable="true"
.
Edit this text!
Here is the code:
<div contentEditable="true" style="border: 1px dashed red; padding 5px;"> <p>Edit this text!</p> </div>
The advantage of this method is that it is compatible with Internet Explorer's contentEditable
special attribute. The disadvantage is that Mozile runs slightly slower using this method, so in most cases the CSS method is preferred.
See mozileDocs.xml for more information.