English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML 参考手册

HTML 标签大全

HTML spellcheck属性

spellcheck 全局属性是枚举属性,定义是否可以检查元素的拼写错误。它可以具有以下值: true, 设置在可能的情况下会去检查元素内容的拼写错误; false, 设置在可能的情况下关闭对元素内容拼写检查.

Atributos globales de HTML

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

在线示例

使用拼写检查的可编辑段落:

!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>HTML spellcheck 属性的使用(基础教程网 oldtoolbag.com)</title>
</head>
<body>
<p contenteditable="true" spellcheck="true">这是一个段落,可以被编辑,您可以尝试修改或删除.</p>
First name: <input type="text" name="fname" spellcheck="true">
<p><strong>Note:</strong> The spellcheck attribute is not supported in Internet Explorer 9 and earlier versions.</p>
</body>
</html>
Prueba aquí ‹/›

Compatibilidad del navegador

IEFirefoxOperaChromeSafari

Internet Explorer 10, Firefox, Opera, Chrome y Safari navegadores admiten la propiedad spellcheck.

Nota: Internet Explorer 9 y versiones de IE anteriores no admiten la propiedad spellcheck.

Definición y uso

La propiedad spellcheck especifica si se debe realizar la corrección ortográfica y gramatical del elemento.

Se puede realizar la corrección ortográfica en el siguiente texto:

  • Valor de texto del elemento de entrada (no contraseña)

  • Texto del elemento <textarea>

  • Texto de elementos editables

HTML 4.01 con HTML5las diferencias

La propiedad spellcheck es de HTML5 Funcionalidades nuevas.

Sintaxis

<elemento spellcheck="verdadero|falso">

Valor de atributo

ValorDescripción
verdaderoSe debe realizar la corrección ortográfica del texto del elemento.
falsoSe debe evitar la corrección ortográfica del texto del elemento.
Atributos globales de HTML