简体   繁体   English

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

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

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 谢谢

I believe you may be looking for <textarea spellcheck="false"></textarea> 我相信你可能正在寻找<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

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转换为Book
  • spellcheck="false" for avoiding OS from highlighting spell errors spellcheck="false"用于避免操作系统突出显示拼写错误

在此输入图像描述

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

 spellcheck="false"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM