forms - Disable spell-checking on HTML textfields

ID : 10053

viewed : 36

Tags : htmlformshtml

Top 5 Answer for forms - Disable spell-checking on HTML textfields

vote vote

98

Update: As suggested by a commenter (additional credit to How can I disable the spell checker on text inputs on the iPhone), use this to handle all desktop and mobile browsers.

<tag autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/> 

Original answer: Javascript cannot override user settings, so unless you use another mechanism other than textfields, this is not (or shouldn't be) possible.

vote vote

89

Yes, use spellcheck="false", as defined by HTML5, for example:

<textarea spellcheck="false">     ... </textarea> 
vote vote

78

For Grammarly you can use:

<textarea data-gramm="false" /> 
vote vote

60

An IFrame WILL "trigger" the spell checker (if it has content-editable set to true) just as a textfield, at least in Chrome.

vote vote

52

The following code snippet disables it for all textarea and input[type=text] elements:

(function () {     function disableSpellCheck() {         let selector = 'input[type=text], textarea';         let textFields = document.querySelectorAll(selector);          textFields.forEach(             function (field, _currentIndex, _listObj) {                 field.spellcheck = false;             }         );     }      disableSpellCheck(); })(); 

Top 3 video Explaining forms - Disable spell-checking on HTML textfields

Related QUESTION?