16

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?

DavidTaubmann
  • 3,025
  • 2
  • 31
  • 43
Alex
  • 64,868
  • 164
  • 416
  • 621
  • I have not herd of rich text inside text areas (but I haven't looked either), but you might want to look into the `contenteditable` attribute. – Petah May 01 '12 at 21:10

4 Answers4

11

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!

DavidTaubmann
  • 3,025
  • 2
  • 31
  • 43
7

Are you looking for Aloha Editor?

It's using the new contenteditable attribute to add a WYSIWYG editor to any div you choose.

Look at the demos.

DavidTaubmann
  • 3,025
  • 2
  • 31
  • 43
Florian Margaine
  • 54,552
  • 14
  • 89
  • 116
5

I believe what you are referring to is the new contentEditable attribute. This is not a textarea, but rather an element attribute. This is good for allowing changes to content.

Try http://html5demos.com/contenteditable

Notice that your browser likely doesn't give you the toolbar with bold, italics, etc. Yet chrome will let you select text and use CTR-B, CTR-I, etc. Things are still being ironed out with this.

Basically, it's a work in progress and your best bet for browser compatability is using a wysiwyg editer like tinymce et al.

Daniel Moses
  • 5,818
  • 25
  • 39
  • 1
    contenteditable attribute seems to be supported by all browsers including old IE so this is not an HTML5 feature. A nice article: http://html5doctor.com/the-contenteditable-attribute/ Many years doing HTML and I didn't knew its existence.... :( – cancerbero Dec 05 '13 at 22:50
  • Wow, I'm just as surprised as you are. You made me look into it's history: http://blog.whatwg.org/the-road-to-html-5-contenteditable – Daniel Moses Dec 06 '13 at 16:14
3

Where have you heard that? Looking at W3Schools > HTML5 > textarea I can't see anything that hints this is true.

Edit: added more links due to comments of people who dislike w3schools

Even tho it's essentially the same thing at this point, here's the link to w3.org for wiki textarea, as well as the spec for textarea. Also, here's the document with differences of html 4 and 5 as of march 29, 2012

MilkyWayJoe
  • 9,072
  • 2
  • 37
  • 53
  • 2
    @MilkyWayJoe The way w3schools presents its information is just as detestable. A link to the actual specification and not unofficial information would have been better. – Snuffleupagus May 01 '12 at 21:28
  • 3
    Ya @MilkyWayJoe I've seen that, written by a W3Schools mod. w3Schools is not affiliated with the W3C in any way but they present themselves as they if they were. Try MDN for future references, like this one: https://developer.mozilla.org/en/HTML/Element/textarea – AlienWebguy May 01 '12 at 21:44