html5 拼写检查属性如何工作?
html5 spellcheck
属性如何工作?
我在 Chrome 17 中看到此页面,该页面应该支持
How does the html5 spellcheck
attribute work?
I am seeing this page with Chrome 17, which is supposed to support spellcheck
on <textarea>
, (but not on <input type='text'>
), but when I type in some non-words in the textarea given in that page, I see no change.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
请参阅此应用于
文本区域
的工作示例。这对我来说适用于 safari、chrome 和 firefox。如果没有,请提供有关您使用的操作系统的信息。目前浏览器支持有限,如下所示。
See this working example applied to a
text area
. That is working in safari, chrome and firefox for me. If not, please provide information about what OS you use.Browser support is currently limited, as you can see below.
随着时间的推移,支持得到了改善。这是更新的表格:
需要考虑的事项:
更多信息:MDN 文章,Wuffo 文章,最新对比表
Support has improved over time. This is an updated table:
Few things to consider:
<textarea>
behave as if it were set to “true”, and<input>
behave as if it were set tofalse
.More info: MDN article, Wuffo article, Latest comparison table
spellcheck
属性在浏览器中的实现仍然很差(如果有的话)。例如,当我访问您在 Chrome 18 中提到的页面并在“应检查此文本区域是否有拼写错误的单词”框中输入拼写错误的单词时。浏览器将“单词”标记为拼写错误。双击其他一些单词也会将其指示为拼写错误。解释是我将西班牙语设置为拼写检查语言。注意:可以通过右键单击输入区域并选择拼写检查设置来更改此语言,但更改在页面重新加载之前不会生效。因此,请检查浏览器中的这些设置。请注意,那里有一个复选框可以控制是否使用拼写检查。
The
spellcheck
attribute is still poorly (if at all) implemented in browsers. For example, when I visit the page you mention in Chrome 18 and type misspelled words into the box “This text area should be checked for mispelled words.” the browser marks “words” as misspelled. Double clicking on some other word makes it indicated as misspelled, too. The explanation is that I had Spanish set as the spellchecking language. Note: This language can be changed by right-clicking on the input are and selecting the spellcheck settings, but the change does not take effect before the page is reloaded.So check out those settings in your browser. Note that there’s a checkbox there that controls whether spellchecking is in use at all.