Today I Learned - Rocky Kev

TIL how to turn anything into a editable text

POSTED ON:

TAGS:

So you'd use a input or textarea field to create a space for the end user to add new content.

Did you know you can also do with that almost any element?

<p contenteditable="true" spellcheck="true">
Hey now, you're an allstar!
</p>

You can even add a spellcheck feature on it!

See the Pen Untitled by rockykev (@rockykev) on CodePen.

REF:
mdn - contenteditable
mdn - spellcheck


Related TILs

Tagged:

TIL Gmail has a 102KB size-limit for HTML

PLACEHOLDER

TIL how Error correction works in HTML

You never get an 'Invalid Syntax' error on an HTML page. Browsers fix any invalid content and go on.

TIL what DOCTYPE means

tl;dr: DOCTYPE declaration in the first line of the HTML file, to instruct the browser to run the code in Standard mode.