html5,什么是isContentEditable?
chrome 支持 isContentEditable
属性(将其列在“检查元素”中),但对 INPUT、FORM 报告 false
- 实际上,所有内容。
例如,对我而言,似乎 INPUT(非只读)应该为 true。
有人知道发生了什么事吗?
chrome supports the isContentEditable
property (lists it in the "Inspect Element"), but reports false
for INPUT, FORM - actually, everything.
too me, for example, seems that INPUT, non-readonly, should be true.
does anybody know what's going on?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
isContentEditable
与表单和输入框没有任何关系。它被设计为一种标记内联可编辑 html 内容的方法。
您可以在此处查看一个工作示例: http://www.navioo.com/javascript/dhtml /isContentEditable_Example_4513.html
您可以在此处阅读相关内容
:http://www.w3.org/TR/2009/WD-html5 -20090423/editing.html
或:http://blog.whatwg.org/the-road-to-html-5-contenteditable
isContentEditable
doesn't have anything to do with forms and input boxes.It was designed to be a way to flag inline editable html content.
You can see a working example here: http://www.navioo.com/javascript/dhtml/isContentEditable_Example_4513.html
You can read about it
here: http://www.w3.org/TR/2009/WD-html5-20090423/editing.html
or: http://blog.whatwg.org/the-road-to-html-5-contenteditable
在支持该元素的浏览器中,元素的 isContentEditable 属性告诉您该元素的直接子内容是否可编辑。它特别适用于常规非交互式内容(即不是表单控件),可以使用
contenteditable
属性使其可编辑:< 的
和上面的isContentEditable
属性;div>元素将报告
true
。但是,请注意,并非所有支持contentEditable
的浏览器也支持isContentEditable
:例如,Firefox 3.x 支持contentEditable
,但 不是isContentEditable
。contenteditable
已在 HTML5 中标准化,但已经存在十多年了。它于 2000 年在 IE 5.5 中首次引入,并最终在几年后进入其他浏览器。 Firefox 从 3.0 版本开始就拥有了它(尽管它从 1.0 之前就拥有文档范围的等效designMode
),而 Safari 从(我认为)2.0 开始就拥有了它。以下是 contentEditable 历史的一个很好的总结: http://blog.whatwg .org/the-road-to-html-5-contenteditable
An element's
isContentEditable
property, in browsers which support it, tells you whether the immediate child content of the element is editable. It applies specifically to regular non-interactive content (i.e. not form controls), which can be made editable using thecontenteditable
attribute:The
isContentEditable
property of both the<div>
and the<i>
elements above will reporttrue
. However, be aware that not every browser that supportscontentEditable
also supportsisContentEditable
: Firefox 3.x, for example, supportscontentEditable
but notisContentEditable
.contenteditable
is standardized in HTML5 but has been around for over a decade. It was first introduced in IE 5.5 in 2000 and eventually made its way into other browsers several years later. Firefox has had it since version 3.0 (although it had the document-wide equivalentdesignMode
since pre-1.0) and Safari since (I think) 2.0.Here's a good summary of the history of contentEditable: http://blog.whatwg.org/the-road-to-html-5-contenteditable