From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../html/global_attributes/spellcheck/index.html | 213 +++++++++++++++++++++ 1 file changed, 213 insertions(+) create mode 100644 files/zh-cn/web/html/global_attributes/spellcheck/index.html (limited to 'files/zh-cn/web/html/global_attributes/spellcheck') diff --git a/files/zh-cn/web/html/global_attributes/spellcheck/index.html b/files/zh-cn/web/html/global_attributes/spellcheck/index.html new file mode 100644 index 0000000000..7e8214cd73 --- /dev/null +++ b/files/zh-cn/web/html/global_attributes/spellcheck/index.html @@ -0,0 +1,213 @@ +--- +title: spellcheck +slug: Web/HTML/Global_attributes/spellcheck +tags: + - spellcheck + - 拼写检查 +translation_of: Web/HTML/Global_attributes/spellcheck +--- +

{{HTMLSidebar("Global_attributes")}}{{SeeCompatTable}}

+ +

spellcheck 全局属性是枚举属性,定义是否可以检查元素的拼写错误。它可以具有以下值: 

+ + + +

如果没有设置这个属性,默认值由元素自身类型和浏览器设置决定。默认值也可以被继承,当有祖先元素的 spellcheck 设置为 true 的情况下,子元素的默认值也是 true
+
+ 你可以参考这篇文章的例子来使用这个属性。

+ +

这个属性是枚举型而不是布尔类型. 这意味着显式设置其中一个值true或false是强制性的,如果使用简写 <label spellcheck>Example Label</label> 是不行的。 正确的用法是 <label spellcheck="true">Example Label</label>.

+ +

这个属性仅仅是浏览器上的提示: 浏览器并不会强制去检查拼写错误,通常不可编辑的元素是不会去检查拼写错误的,就算它的spellcheck 属性被设置为true而且浏览器支持拼写检查。

+ +

各个浏览器的默认设置和元素依赖:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
浏览器{{ HTMLElement("html") }}{{ HTMLElement("textarea") }}{{ HTMLElement("input") }}其他附注
Firefoxfalsefalsefalseinheritedlayout.spellcheckDefault 值为 0
falsetrueinheritedinheritedlayout.spellcheckDefault 值为 1 (default value)
falsetruetrueinheritedlayout.spellcheckDefault 值为 2
Seamonkeyfalsefalsefalseinheritedlayout.spellcheckDefault 值为 0
falsetrueinheritedinheritedlayout.spellcheckDefault 值为 1(默认如此)
falsetruetrueinheritedlayout.spellcheckDefault 值为 2
Caminofalsefalsefalseinheritedlayout.spellcheckDefault 值为 0
falsetrueinheritedinheritedlayout.spellcheckDefault 值为 1
falsetruetrueinheritedlayout.spellcheckDefault 值为 2(默认如此)
Chromefalsetrue?inherited
Internet Explorerfalsetrue?inherited
Operafalsetrue?inherited
Safarifalsetrue?inherited
+ +

规范

+ + + + + + + + + + + + + + + + + + + +
规范状态附注
{{SpecName('HTML WHATWG', "interaction.html#spelling-and-grammar-checking", "spellcheck")}}{{Spec2('HTML WHATWG')}}与最新的快照相比没有变化, {{SpecName('HTML5.1')}}
{{SpecName('HTML5.1', "editing.html#spelling-and-grammar-checking", "spellcheck")}}{{Spec2('HTML5.1')}}{{SpecName('HTML WHATWG')}} 的快照,初始定义
+ +

浏览器兼容性

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + +
功能ChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{ CompatVersionUnknown() }}{{ CompatGeckoDesktop("1.8.1") }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
功能AndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{ CompatNo() }}{{ CompatUnknown}}{{ CompatGeckoMobile("1.8.1") }}{{ CompatUnknown() }}{{ CompatUnknown() }}{{ CompatUnknown() }}
+
+ +

另见

+ + -- cgit v1.2.3-54-g00ecf