HTML 5: SPELLCHECK

SpellCheck specifies if the element must have its spelling and grammar checked.


The spellcheck attribute specifies whether the element should have its spelling checked.


The following text can be spellchecked:


  • The text values in input elements (not password) 
  • The text in <textarea> elements
  • The  text in editable elements.


BROWSER COMPATIBILITY





Markup
3.0.6
1.0.154.48 3.2.19.62
<input type=text>offer on right-clickno checkcheck as you typeoffer on right-click
<input type=text spellcheck=true>check as you typeno checkcheck as you typeoffer on right-click
<input type=text spellcheck=false>offer on right-clickno checkcheck as you typeoffer on right-click
<input type=text spellcheck>invalidoffer on right-clickno checkcheck as you typeoffer on right-click
<input type=text spellcheck=spellcheck> invalidoffer on right-clickno checkcheck as you typeoffer on right-click
<input type=text spellcheck=on> invalidoffer on right-clickno checkcheck as you typeoffer on right-click
<input type=text spellcheck=off> invalidoffer on right-clickno checkcheck as you typeoffer on right-click
<textarea>check as you typecheck as you typecheck as you typeoffer on right-click
<textarea spellcheck=true>check as you typecheck as you typecheck as you typeoffer on right-click
<textarea spellcheck=false>offer on right-clickcheck as you typecheck as you typeoffer on right-click
<textarea spellcheck> invalidcheck as you typecheck as you typecheck as you typeoffer on right-click
<textarea spellcheck=spellcheck> invalidcheck as you typecheck as you typecheck as you typeoffer on right-click
<textarea spellcheck=on>invalidcheck as you typecheck as you typecheck as you typeoffer on right-click
<textarea spellcheck=off>invalidcheck as you typecheck as you typecheck as you typeoffer on right-click
In other words:
  • In the absence of the spellcheck attribute, Firefox offers as-you-type spellcheck<textarea> elements but not <input type=text> elements. It treats thespellcheck attribute with a true or false value as a signal to offer as-you-type spellcheck (or turn it off where it defaults to on). All invalid markup variations are ignored, in the sense that they do not change Firefox's per-element-type defaults. It lets the user turn spellcheck on and off on a per-element basis, which overrides both the spellcheck attribute and the browser's per-element-type defaults.
  • Google Chrome offers as-you-type spellcheck on <textarea> elements but not<input type=text> elements. It ignores the spellcheck attribute entirely. It does not offer the end user the option to change the default behavior or manually check individual fields.
  • Safari 3 offers as-you-type spellcheck on <textarea> and <input type=text>elements. It ignores the spellcheck attribute entirely. It allows the user to toggle as-you-type spellcheck globally, which immediately affects all elements of all types. It does not offer the end user the option to change the default behavior or manually check individual fields.
  • Opera 9 offers spellcheck from the context menu on <textarea> and <input type=text> elements. It ignores the spellcheck attribute entirely. It does not offer as-you-type spellcheck.



EXAMPLE


This is a paraggragraph. It is editable. Try to change this text.

Code:
<p contenteditable="true" spellcheck="true"> This is a paraggragraph. It is editable. Try to change this text.</p>


Comments

Popular posts from this blog

Basketball Hand Signals

Uhaw ang Tigang na Lupa- Liwayway A. Arceo

White Dots