November 2011
Intermediate to advanced
384 pages
13h 23m
English
You can configure any static text block to become editable by the user within any HTML5 web browser using the new contenteditable attribute. When activated, the text block will appear normal, but when it is clicked, it will transform into a form input field prepopulated with the current text.
This technique can apply to almost any text block, including sentences that are wrapped with <span>, paragraphs, headings, articles, and the entire body of a web page. This is possible because contenteditable is actually a global attribute, meaning it can apply to basically any tag, regardless of context:
<p contenteditable='true'>Editable Paragraph Text</p>
If any elements exist under a contenteditable block, they inherit ...
Read now
Unlock full access