Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 rich-text inside textarea

I heard that the new HTML5 will add rich text capability to textareas (it will make them more flexible), so you can do stuff like code syntax highlighting editors without very nasty javascript (like creating iframes and stuff).

Is this true? Are there browsers with support for it yet? And where can I find some API?

like image 479
Alex Avatar asked May 01 '12 21:05

Alex


People also ask

Can I embed HTML formatting inside of a textarea tag?

You are correct, it cannot be done. According to MDN, "character data" is the only permitted content for a <textarea> . As other answers have described, what you are looking for is a WYSIWYG editor, like CKEditor, TinyMCE, or Kendo's Editor.

How do I get textarea to show HTML text?

Complete HTML/CSS Course 2022Use the <textarea> tag to show a text area. The HTML <textarea> tag is used within a form to declare a textarea element - a control that allows the user to input text over multiple rows. Specifies that on page load the text area should automatically get focus.

Can we use value attribute in textarea?

<textarea> does not support the value attribute.


1 Answers

Whitout jQuery

If what you where looking for NO-jquery tools (pure HTML/CSS + basic JS) as us, then some of the best options found (back in 2016) are:

  1. wysihtml5
  2. Squire
  3. ckeditor
  4. widgEditor

Nevertheless, those in the list above all convert the element (textarea) into an iframe, so they weren't exactly what we were searching for, finally we found this one which respects the original element (divs or so, but if you use textarea it does creates an additional div), allowing full straightforward JS app development:

  1. nicedit

We hope this helps you too!

like image 177
DavidTaubmann Avatar answered Oct 11 '22 00:10

DavidTaubmann