Thursday 4 December 2014

Editable div in Html 5 with contenteditable attribute

We use input or textarea are use to edit or input text. But now a days when we need design as well as editable things we need more than that.

The contenteditable attribute specifies whether the content of an element is editable or not.

Any elements with the 
contenteditable attribute set will have a grey outline as you hover over. Feel free to edit and change their contents. I'm using local storage to maintain your changes.

           contenteditable=""  or  contenteditable="true"
Indicates that the element is editable.

           contenteditable"false"
Indicates that the element is not editable.

            contenteditable"inherit"
Indicates that the element is editable if its immediate parent element is editable. This is the default value.


 This is div with 'contenteditable' true.
<div id="example" contenteditable="true">

Editable text



No comments:

Post a Comment