We have a web application that has a large number of contentEditable <div>
's. With the aggressive autocorrect in Safari on Mac OS X Lion, we have had a number of problems with Safari attempting to autocorrect for our users.
I have been able to stop this from happening by manually going to 'Edit>Spelling and Grammar' and disabling the 'Correct Spelling Automatically' option. I'm wondering, however, if there is a way to do this programmatically, either in javascript or using html attributes. From Apple's documentation (https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/DesigningForms/DesigningForms.html), there is an 'autocorrect' attribute on html form fields that let the site designer decide if autocorrect should be on or not.
Is this 'autocorrect' attribute only on mobile safari? Does it work on contentEditable divs? If not, is there an alternative other that just telling the users to go and turn off autocorrect manually?
You can use the spellcheck
attribute to enable or disable spell checking (possible values are true
and false
)
You can find more details about this attribute in the HTML5 spec.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With