contenteditable Attribute

Description

The contenteditable attribute is new in HTML5 and allows the user to change the content in the page.

Example


<!DOCTYPE HTML>
<html>
<body>
   <p contenteditable="true">It is  raining right  now</p>
</body><!--  w ww.ja v a  2  s  .c  o  m-->
</html>

Click to view the demo

The code above applies the contenteditable attribute to a p element.

Setting the attribute value to true allows the user to edit the element contents, and setting it to false disables this feature.

If you don't specify a value, the element inherits the setting for this property from its parent.

The user clicks on the text and starts to type.





















Home »
  HTML CSS »
    HTML »




HTML Introduction
HTML Document
HTML Section
HTML Group Content
HTML Text Marker
HTML Table
HTML Form
HTML Embed