html rich text,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?

回答1:

NO - jQuery

If what you where looking for (the same as me) is NO-jquery tools (pure HTML/CSS + basic JS), then some of the best options I found are:

wysihtml5

Squire

ckeditor

widgEditor

Nevertheless, those in the list above all convert the element (textarea) into an iframe, so they weren't exactly what I was searching for, finally I 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:

nicedit

Hope this helps you too!

回答2:

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.

回答3:

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.

回答4:

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

来源:https://stackoverflow.com/questions/10404312/html5-rich-text-inside-textarea

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值