Turn off grammar correction in a contenteditable div in FireFox

前端 未结 3 494
闹比i
闹比i 2021-01-17 20:17

I have contenteditable div with text on it. In firefox, there is some kind of grammar correction which underlines the text with red marking. How can I turn it off?

3条回答
  •  悲哀的现实
    2021-01-17 21:04

    According to MDN:

    Starting in Gecko 9.0 (Firefox 9.0 / Thunderbird 9.0 / SeaMonkey 2.6), the spell checker uses the element's lang attribute to determine the default spell checker language. If doesn't have a lang attribute, that attribute is searched each successive parent element and upward toward the root node until one is found.

    So to disable spellcheck, not only do I add spellcheck="false", but I also add a lang tag with a dictionary not found on the users computer.

    This should work on most systems outside of Kronos.

提交回复
热议问题