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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3496658/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 04:09:31  来源:igfitidea点击:

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

htmltextareaautocorrect

提问by aryaxt

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

谢谢

回答by Robert

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

回答by Mohsen

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:

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

  • autocorrect="off"for avoiding to complete or suggest a word
  • autocapitalize="off"for avoiding OS transforming bookto Book
  • spellcheck="false"for avoiding OS from highlighting spell errors
  • autocorrect="off"避免完成或建议一个词
  • autocapitalize="off"避免操作系统转换bookBook
  • spellcheck="false"避免操作系统突出显示拼写错误

enter image description here

在此处输入图片说明

回答by hollsk

Try adding the following code to your textarea:

尝试将以下代码添加到您的文本区域:

 spellcheck="false"