onblur
- Type: script code
- This event is sent when a
textbox
loses keyboard focus.
Note: The behavior of this event has evolved over time. Prior to Gecko 1.9 (Firefox 3), the script code would execute in the context of the anonymous HTML
<input>
element inside the
textbox
binding. From Gecko 1.9 to Gecko 12.0 (Firefox 12.0 / Thunderbird 12.0 / SeaMonkey 2.9), the script code would actually execute twice, once in the context of the anonymous HTML
<input>
element and once in the context of the
<textbox>
element itself. As of Gecko 13.0 (Firefox 13.0 / Thunderbird 13.0 / SeaMonkey 2.10), the script code only runs in the context of the
<textbox>
element, matching the behavior of all other event handlers.
onfocus
- Type: script code
- This event is sent when a
textbox
receives keyboard focus.
Note: The behavior of this event has evolved over time. Prior to Gecko 1.9 (Firefox 3), the script code would execute in the context of the anonymous HTML
<input>
element inside the
textbox
binding. From Gecko 1.9 to Gecko 12.0 (Firefox 12.0 / Thunderbird 12.0 / SeaMonkey 2.9), the script code would actually execute twice, once in the context of the anonymous HTML
<input>
element and once in the context of the
<textbox>
element itself. As of Gecko 13.0 (Firefox 13.0 / Thunderbird 13.0 / SeaMonkey 2.10), the script code only runs in the context of the
<textbox>
element, matching the behavior of all other event handlers.
-
spellcheck
- Type: boolean
- If
true
, spell checking is enabled by default for the text box; if false
, spell checking is disabled by default.
- If not specified, this defaults to
false
The HTML
The spellcheck
attribute uses values of true or false (you cannot simply add the spellcheck attribute to a given element):
<input type="text" spellcheck="true" /><br />
<textarea spellcheck="true"></textarea>
<div contenteditable="true" spellcheck="true">I am some content</div>
<input type="text" spellcheck="false" /><br />
<textarea spellcheck="false"></textarea>
<div contenteditable="true" spellcheck="false">I am some content</div>
You can use spellcheck on INPUT
, TEXTAREA
, and contenteditable
elements. Thespellcheck
attribute works well paired with the autocomplete, autocapitalize, and autocorrect attributes too!
Added from David Walsh's article on Spell Check.
The following classes may be used to style the element. These classes should be used instead of changing the style of the element directly since they will fit more naturally with the user's selected theme.