HTML - 如何在TEXTAREA中禁用自动文本更正?

时间:2022-06-04 17:28:18

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?

我的textarea包含C#代码,所以我得到了整个地方的红色下划线,有没有办法在html代码中禁用TEXTAREA上的自动更正?

Thank

谢谢

3 个解决方案

#1


53  

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

我相信你可能正在寻找

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

资料来源:https://developer.mozilla.org/en/controlling_spell_checking_in_html_forms

#2


25  

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:

对于iOS(也可能是Android),除了spellcheck =“false”之外还有两个属性可能需要添加到文本输入中,以避免操作系统干扰文本内容:

  • autocorrect="off" for avoiding to complete or suggest a word
  • autocorrect =“off”用于避免完成或建议单词
  • autocapitalize="off" for avoiding OS transforming book to Book
  • autocapitalize =“off”用于避免操作系统将书籍转换为Book
  • spellcheck="false" for avoiding OS from highlighting spell errors
  • spellcheck =“false”用于避免操作系统突出显示拼写错误

HTML  - 如何在TEXTAREA中禁用自动文本更正?

#3


3  

Try adding the following code to your textarea:

尝试将以下代码添加到textarea:

 spellcheck="false"

#1


53  

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

我相信你可能正在寻找

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

资料来源:https://developer.mozilla.org/en/controlling_spell_checking_in_html_forms

#2


25  

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:

对于iOS(也可能是Android),除了spellcheck =“false”之外还有两个属性可能需要添加到文本输入中,以避免操作系统干扰文本内容:

  • autocorrect="off" for avoiding to complete or suggest a word
  • autocorrect =“off”用于避免完成或建议单词
  • autocapitalize="off" for avoiding OS transforming book to Book
  • autocapitalize =“off”用于避免操作系统将书籍转换为Book
  • spellcheck="false" for avoiding OS from highlighting spell errors
  • spellcheck =“false”用于避免操作系统突出显示拼写错误

HTML  - 如何在TEXTAREA中禁用自动文本更正?

#3


3  

Try adding the following code to your textarea:

尝试将以下代码添加到textarea:

 spellcheck="false"