admin管理员组文章数量:1322838
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?
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?
Share Improve this question asked Sep 21, 2011 at 9:39 cc youngcc young 20.2k32 gold badges94 silver badges150 bronze badges 1-
What is
isContentEditable
? – Alex Commented Sep 21, 2011 at 9:44
2 Answers
Reset to default 10isContentEditable
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./javascript/dhtml/isContentEditable_Example_4513.html
You can read about it
here: http://www.w3/TR/2009/WD-html5-20090423/editing.html
or: http://blog.whatwg/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 the contenteditable
attribute:
<div contenteditable="true">This text is all <i>editable</i></div>
The isContentEditable
property of both the <div>
and the <i>
elements above will report true
. However, be aware that not every browser that supports contentEditable
also supports isContentEditable
: Firefox 3.x, for example, supports contentEditable
but not isContentEditable
.
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 equivalent designMode
since pre-1.0) and Safari since (I think) 2.0.
Here's a good summary of the history of contentEditable: http://blog.whatwg/the-road-to-html-5-contenteditable
本文标签: javascriptHTML5what is isContentEditableStack Overflow
版权声明:本文标题:javascript - html5, what is isContentEditable? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741147858a2347402.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论