Archive for May, 2007

Working with FireFox 2.0’s Built-in Spellcheck

Tuesday, May 15th, 2007

FireFox 2.0 has a pretty nice little built in spellchecker. By default, FF 2.0 spell checks <textarea>s. It doesn’t spell check <input>s with type="text". I’m not really sure why, but that seems to be the default behavior when I was mucking around with form elements.

A quick examination of the HTML elements themselves reveals that FireFox attaches a custom attribute called "spellcheck" to our textarea. "spellcheck" accepts a boolean to determine whether or not it will actually be used. Go ahead, create a textarea with the attribute spellcheck="false". No more spell check.

Adding FireFox spellchecking works the same way. Just give an element the "spellcheck" attribute and set its value to true (or anything that evaluates to true). FireFox 2.0 now will correct the spelling of that element, provided it’s an HTML element capable of capturing input. (I tried adding it to other non-form elements, and, unfortunately, it didn’t work. A little script that flicked on spellchecking when you were developing a page would be great, but it doesn’t look possible as only input-related tags are covered.)

technorati tags:, ,

I'm Reading…
Search This Site
You are currently browsing the A Modern Fable weblog archives for May, 2007.

AddThis Feed Button

Need great hosting?

Categories