Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spellcheck disable with CSS not HTML

Tags:

html

css

I want to disable spellchecking in Chrome/Safari using CSS. In HTML spellcheck="false" works but I want to do this in a way that will affect all input fields. I tried input{spellcheck: disabled} but this didn't work.

like image 682
xiphos_ Avatar asked Feb 09 '12 10:02

xiphos_


People also ask

How do I turn off spell check in HTML?

Output: Disabling Spell Check in a HTML Form: To disable spellcheck in a HTML form the spellcheck attribute is set to “false”.

Is spell check is an HTML global attribute?

The spellcheck global attribute is an enumerated attribute defines whether the element may be checked for spelling errors.

How do I turn on spell check in HTML?

The spellcheck attribute specifies whether the element is to have its spelling and grammar checked or not. The following can be spellchecked: Text values in input elements (not password) Text in <textarea> elements.

How do I turn off spell check in textarea?

To disable spell check in textarea atrribute spellcheck=”false” can be used.


2 Answers

use jQuery. Something like:

$(document).ready( function() {
    $("input[type='text'], textarea").attr('spellcheck',false);
});

This should search for all textbox's and teatarea's on the page and add the attribute spellcheck="false" to them.

like image 190
Deadlykipper Avatar answered Sep 28 '22 22:09

Deadlykipper


This does not belong to the realm of CSS (which is optional presentational suggestions). It is not about stylistic features of rendering data but about processing data interactively.

On browsers that support “spell checking” (which may involve grammar and style checks), the HTML attribute spellcheck or the corresponding IDL (DOM) attribute, settable in JavaScript, is effective.

In practice, those browsers tend to have “spelling checking” enabled by default for textareas only, and as textareas normally contain human language texts, turning it off does not sound useful. It is in any case user-controllable (the user can switch it off or select language).

like image 30
Jukka K. Korpela Avatar answered Sep 28 '22 20:09

Jukka K. Korpela