HTML spellcheck 属性
标签" href="tag-main.html"><main>
<map>
<mark>
<menu>
<meta>
<meter>
<nav>
<noframes>
<noscript>
<object>
<ol>
<optgroup>
<option>
<output>
<p>
<param>
<pre>
<html>
<picture>
<progress>
<q>
<rp>
<rt>
<ruby>
<s>
<samp>
<script>
<section>
<select>
<small>
<source>
<span>
<strike>
<strong>
<style>
<sub>
<summary>
<sup>
<table>
<tbody>
<td>
<textarea>
< template>
<tfoot>
<th>
<thead>
<time>
<title>
<tr>
<track>
<tt>
<u>
<ul>
<var>
<video>
<wbr>
HTML spellcheck 属性
实例
带有编写检查的可编辑段落:
<p contenteditable="true" spellcheck="true">这是可编辑的段落。请试着编辑文本。</p>
浏览器支持
Internet Explorer 10, Firefox, Opera, Chrome, 和 Safari 浏览器支持 spellcheck 属性。
注意: Internet Explorer 9 及更早IE版本不支持 spellcheck 属性。
定义和用法
spellcheck 属性规定是否对元素内容进行拼写检查。
可对以下文本进行拼写检查:
- 类型为 text 的 input 元素中的值(非密码)
- textarea 元素中的值
- 可编辑元素中的值
HTML 4.01 与 HTML5之间的差异
spellcheck 属性是 HTML5 新增的。
语法
<element spellcheck="true|false">
属性值
| 值 | 描述 |
|---|---|
| true | 规定应当对元素的文本进行拼写检查。 |
| false | 规定不应对元素的文本进行拼写检查。 |
HTML 全局属性