Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 720673 of spellcheck

  • Revision slug: Web/HTML/Global_attributes/spellcheck
  • Revision title: spellcheck
  • Revision id: 720673
  • Created:
  • Creator: teoli
  • Is current revision? Yes
  • Comment Linkified global attribute

Revision Content

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

The spellcheck global attribute is an enumerated attribute defines whether the element may be checked for spelling errors. 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.

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.

You can consult this article to see a comprehensive example of the use of this attribute.

This 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 <label spellcheck>Example Label</label> is not allowed. The correct usage is <label spellcheck="true">Example Label</label>.

This attribute is merely a hint for the browser: browsers are not required to be able 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.

The default value of this attribute is browser and element-dependant:

Browser {{ HTMLElement("html") }} {{ HTMLElement("textarea") }} {{ HTMLElement("input") }} others Comment
Firefox false false false inherited When layout.spellcheckDefault is 0
false true inherited inherited When layout.spellcheckDefault is 1 (default value)
false true true inherited When layout.spellcheckDefault is 2
Seamonkey false false false inherited When layout.spellcheckDefault is 0
false true inherited inherited When layout.spellcheckDefault is 1 (default value)
false true true inherited When layout.spellcheckDefault is 2
Camino false false false inherited When layout.spellcheckDefault is 0
false true inherited inherited When layout.spellcheckDefault is 1
false true true inherited When layout.spellcheckDefault is 2 (default value)
Chrome false true ? inherited
Internet Explorer false true ? inherited
Opera false true ? inherited
Safari false true ? inherited

Specifications

Specification Status Comment
{{SpecName('HTML WHATWG', "interaction.html#spelling-and-grammar-checking", "spellcheck")}} {{Spec2('HTML WHATWG')}} No change from latest snapshot, {{SpecName('HTML5.1')}}
{{SpecName('HTML5.1', "editing.html#spelling-and-grammar-checking", "spellcheck")}} {{Spec2('HTML5.1')}} Snapshot of {{SpecName('HTML WHATWG')}}, initial definition

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{ CompatVersionUnknown() }} {{ CompatGeckoDesktop("1.8.1") }} {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }}
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{ CompatNo() }} {{ CompatUnknown}} {{ CompatGeckoMobile("1.8.1") }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}

See also

Revision Source

<p class="note">{{HTMLSidebar("Global_attributes")}}{{SeeCompatTable}}</p>
<p>The <strong>spellcheck</strong> <a href="/en-US/docs/Web/HTML/Global_attributes">global attribute</a> is an enumerated attribute defines whether the element may be checked for spelling errors. It may have the following values:</p>
<ul>
 <li><code>true</code>, which indicates that the element should be, if possible, checked for spelling errors;</li>
 <li><code>false</code>, which indicates that the element should not be checked for spelling errors.</li>
</ul>
<p>If this attribute is not set, its default value is element-type and browser-defined. This default value may also be <em>inherited</em>, which means that the element content will be checked for spelling errors only if its nearest ancestor has a <em>spellcheck</em> state of <code>true</code>.<br />
 <br />
 You can consult <a href="/en/HTML/Controlling_spell_checking_in_HTML_forms" title="en/Controlling spell checking in HTML forms">this article</a> to see a comprehensive example of the use of this attribute.</p>
<p>This attribute is an <em>enumerated</em> one and not a <em>Boolean </em>one. This means that the explicit usage of one of the values <code>true</code> or <code>false</code> is mandatory and that a shorthand like <code>&lt;label spellcheck&gt;Example Label&lt;/label&gt; </code>is not allowed. The correct usage is <code>&lt;label spellcheck="true"&gt;Example Label&lt;/label&gt;</code>.</p>
<p>This attribute is merely a hint for the browser: browsers are not required to be able to check for spelling errors. Typically non-editable elements are not checked for spelling errors, even if the <strong>spellcheck</strong> attribute is set to true and the browser supports spellchecking.</p>
<p>The <em>default value</em> of this attribute is browser and element-dependant:</p>
<table class="fullwidth-table">
 <tbody>
  <tr>
   <th>Browser</th>
   <th>{{ HTMLElement("html") }}</th>
   <th>{{ HTMLElement("textarea") }}</th>
   <th>{{ HTMLElement("input") }}</th>
   <th>others</th>
   <th>Comment</th>
  </tr>
  <tr>
   <td rowspan="3">Firefox</td>
   <td><code>false</code></td>
   <td><code>false</code></td>
   <td><code>false</code></td>
   <td><em>inherited</em></td>
   <td>When <code>layout.spellcheckDefault</code> is <code>0</code></td>
  </tr>
  <tr>
   <td><strong><code>false</code></strong></td>
   <td><strong><code>true</code></strong></td>
   <td><strong><em>inherited</em></strong></td>
   <td><strong><em>inherited</em></strong></td>
   <td><strong>When <code>layout.spellcheckDefault</code> is <code>1</code> (default value)</strong></td>
  </tr>
  <tr>
   <td><code>false</code></td>
   <td><code>true</code></td>
   <td><code>true</code></td>
   <td><em>inherited</em></td>
   <td>When <code>layout.spellcheckDefault</code> is <code>2</code></td>
  </tr>
  <tr>
   <td rowspan="3">Seamonkey</td>
   <td><code>false</code></td>
   <td><code>false</code></td>
   <td><code>false</code></td>
   <td><em>inherited</em></td>
   <td>When <code>layout.spellcheckDefault</code> is <span style="font-family: Courier New;"><code>0</code></span></td>
  </tr>
  <tr>
   <td><strong><code>false</code></strong></td>
   <td><strong><code>true</code></strong></td>
   <td><strong><em>inherited</em></strong></td>
   <td><strong><em>inherited</em></strong></td>
   <td><strong>When <code>layout.spellcheckDefault</code> is <span style="font-family: Courier New;">1</span> (default value)</strong></td>
  </tr>
  <tr>
   <td><code>false</code></td>
   <td><code>true</code></td>
   <td><code>true</code></td>
   <td><em>inherited</em></td>
   <td>When <code>layout.spellcheckDefault</code> is <span style="font-family: Courier New;"><code>2</code></span></td>
  </tr>
  <tr>
   <td rowspan="3">Camino</td>
   <td><code>false</code></td>
   <td><code>false</code></td>
   <td><code>false</code></td>
   <td><em>inherited</em></td>
   <td>When <code>layout.spellcheckDefault</code> is <span style="font-family: Courier New;"><code>0</code></span></td>
  </tr>
  <tr>
   <td><code>false</code></td>
   <td><code>true</code></td>
   <td><em>inherited</em></td>
   <td><em>inherited</em></td>
   <td>When <code>layout.spellcheckDefault</code> is <span style="font-family: Courier New;"><code>1</code></span></td>
  </tr>
  <tr>
   <td><strong><code>false</code></strong></td>
   <td><strong><code>true</code></strong></td>
   <td><strong><code>true</code></strong></td>
   <td><strong><em>inherited</em></strong></td>
   <td><strong>When <span style="font-family: Courier New;">layout.spellcheckDefault</span> is <span style="font-family: Courier New;"><code>2</code> </span><strong>(default value)</strong></strong></td>
  </tr>
  <tr>
   <td>Chrome</td>
   <td><code>false</code></td>
   <td><code>true</code></td>
   <td>?</td>
   <td><em>inherited</em></td>
  </tr>
  <tr>
   <td>Internet Explorer</td>
   <td><code>false</code></td>
   <td><code>true</code></td>
   <td>?</td>
   <td><em>inherited</em></td>
  </tr>
  <tr>
   <td>Opera</td>
   <td><code>false</code></td>
   <td><code>true</code></td>
   <td>?</td>
   <td><em>inherited</em></td>
  </tr>
  <tr>
   <td>Safari</td>
   <td><code>false</code></td>
   <td><code>true</code></td>
   <td>?</td>
   <td><em>inherited</em></td>
  </tr>
 </tbody>
</table>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('HTML WHATWG', "interaction.html#spelling-and-grammar-checking", "spellcheck")}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
   <td>No change from latest snapshot, {{SpecName('HTML5.1')}}</td>
  </tr>
  <tr>
   <td>{{SpecName('HTML5.1', "editing.html#spelling-and-grammar-checking", "spellcheck")}}</td>
   <td>{{Spec2('HTML5.1')}}</td>
   <td>Snapshot of {{SpecName('HTML WHATWG')}}, initial definition</td>
  </tr>
 </tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
 <table class="compat-table">
  <tbody>
   <tr>
    <th>Feature</th>
    <th>Chrome</th>
    <th>Firefox (Gecko)</th>
    <th>Internet Explorer</th>
    <th>Opera</th>
    <th>Safari</th>
   </tr>
   <tr>
    <td>Basic support</td>
    <td>{{ CompatVersionUnknown() }}</td>
    <td>{{ CompatGeckoDesktop("1.8.1") }}</td>
    <td>{{ CompatVersionUnknown() }}</td>
    <td>{{ CompatVersionUnknown() }}</td>
    <td>{{ CompatVersionUnknown() }}</td>
   </tr>
  </tbody>
 </table>
</div>
<div id="compat-mobile">
 <table class="compat-table">
  <tbody>
   <tr>
    <th>Feature</th>
    <th>Android</th>
    <th>Chrome for Android</th>
    <th>Firefox Mobile (Gecko)</th>
    <th>IE Mobile</th>
    <th>Opera Mobile</th>
    <th>Safari Mobile</th>
   </tr>
   <tr>
    <td>Basic support</td>
    <td>{{ CompatNo() }}</td>
    <td>{{ CompatUnknown}}</td>
    <td>{{ CompatGeckoMobile("1.8.1") }}</td>
    <td>{{ CompatUnknown() }}</td>
    <td>{{ CompatUnknown() }}</td>
    <td>{{ CompatUnknown() }}</td>
   </tr>
  </tbody>
 </table>
</div>
<h2 id="See_also">See also</h2>
<ul>
 <li>All <a href="/en-US/docs/Web/HTML/Global_attributes">global attributes</a>.</li>
</ul>
Revert to this revision