Turn off grammar correction in a contenteditable div in FireFox

前端 未结 3 517
闹比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:03

    Try --

    
    

    Since the above is a Firefox-only attribute, if you're concerned about validation, you can also use jQuery to set the attribute, e.g.

    $('.textarea_you_want_to_target').attr('spellcheck', false);
    


    Update

    It seems in Firefox you have to set spellcheck="false" on . See http://jsfiddle.net/26JkW/5/

提交回复
热议问题