spellcheck - HTML: HyperText Markup Language 编辑
The spellcheck
global attribute is an enumerated attribute defines whether the element may be checked for spelling errors.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.It may have the following values:
true
, which indicates that the element should be, if possible, checked for spelling errors;false
, which indicates that the element should not be checked for spelling errors.
Note: The spellcheck
attribute is an enumerated one and not a Boolean one. This means that the explicit usage of one of the values true
or false
is mandatory, and that a shorthand like <textarea spellcheck></textarea>
is not allowed. The correct usage is <textarea spellcheck="true"></textarea>
.
If this attribute is not set, its default value is element-type and browser-defined. This default value may also be inherited, which means that the element content will be checked for spelling errors only if its nearest ancestor has a spellcheck state of true
.
This attribute is merely a hint for the browser: browsers are not required to check for spelling errors. Typically non-editable elements are not checked for spelling errors, even if the spellcheck
attribute is set to true
and the browser supports spellchecking.
Specifications
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of 'spellcheck' in that specification. | Living Standard | No change from latest snapshot, HTML 5.1 |
HTML 5.1 The definition of 'spellcheck' in that specification. | Recommendation | Snapshot of HTML Living Standard, initial definition |
Browser compatibility
BCD tables only load in the browser
See also
- All global attributes.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论