HTML - How can i disable auto text correction in my TEXTAREA?

后端 未结 3 710
情书的邮戳
情书的邮戳 2021-02-06 20:56

My textarea contains C# code, so i get red underlines all over the place, is there any way to disable auto correction on a TEXTAREA in html code?

Thank

相关标签:
3条回答
  • 2021-02-06 21:18

    I believe you may be looking for <textarea spellcheck="false"></textarea>

    Source: https://developer.mozilla.org/en/controlling_spell_checking_in_html_forms

    0 讨论(0)
  • 2021-02-06 21:23

    There are two more attributes other than spellcheck="false" for iOS (probably Android too) that you might need to add to your text inputs to avoid OS interferer with text content:

    • autocorrect="off" for avoiding to complete or suggest a word
    • autocapitalize="off" for avoiding OS transforming book to Book
    • spellcheck="false" for avoiding OS from highlighting spell errors

    enter image description here

    0 讨论(0)
  • 2021-02-06 21:36

    Try adding the following code to your textarea:

     spellcheck="false"
    
    0 讨论(0)
提交回复
热议问题