Enable/Disable autocorrect on an input/textarea
NicolasBrondinBernard
Want to remove the small red squiggly lines that appear in your form fields? Here's the solution!

Article published on 05/09/2022, last updated on 10/08/2026
Whether for educational purposes, or related to a specific feature, it's sometimes useful to be able to enable or disable spelling and grammar correction in your web page forms!
It's also good to know that the behavior of the spell checker is entirely tied to the browser itself, both in terms of its effectiveness and its appearance.
The general behavior is that correction is active by default on a
But here's how to enable/disable it using a simple "spellcheck" attribute:
<input type="text" spellcheck="true"/>
<!-- ou -->
<textarea spellcheck="false"></textarea>
Note that the "spellcheck" attribute is currently fully compatible with only 36.65% of browsers. Mobile browsers sometimes ignore the spellcheck="false" value.
Find more information about the attribute in the Mozilla Developer Network documentation!
I hope this article was useful to you, and see you soon on the blog!
Complete courses, exercises and certificates to really learn programming!
4.8 average rating
No comments yet