html5 拼写检查属性如何工作?

发布于 2025-01-07 21:56:59 字数 361 浏览 0 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

稚气少女 2025-01-14 21:57:00

请参阅此应用于文本区域的工作示例。这对我来说适用于 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.

table of support

逐鹿 2025-01-14 21:57:00

随着时间的推移,支持得到了改善。这是更新的表格:

在此处输入图像描述

需要考虑的事项:

  • 默认值取决于元素和浏览器。一般来说,contenteditable 和
  • 拼写检查不会影响验证。
  • Android 提供自动建议,但不支持拼写检查。

更多信息:MDN 文章Wuffo 文章最新对比表

Support has improved over time. This is an updated table:

enter image description here

Few things to consider:

  • Default value depends on the element and browser. Generally, contenteditable and <textarea> behave as if it were set to “true”, and <input> behave as if it were set to false.
  • Spellcheck does not impact validation.
  • Android provides autosuggest, but doesn’t support spellcheck.

More info: MDN article, Wuffo article, Latest comparison table

巷雨优美回忆 2025-01-14 21:57:00

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文