Html 如何在 iPhone 上的文本输入上禁用拼写检查器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3416867/
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:00:22  来源:igfitidea点击:

How can I disable the spell checker on text inputs on the iPhone

htmlmobile-safarispell-checking

提问by Ben Shelock

Sometimes the spell checker is unnecessary, captchas, usernames, emails, etc. Is there a way disable it on some text inputs/text areas?

有时拼写检查器是不必要的,验证码、用户名、电子邮件等。有没有办法在某些文本输入/文本区域禁用它?

回答by David Kaneda

As noted by my buddy Jonathan Stark, you should be able to use attributes like autocorrect and autocomplete to achieve the effect you're looking for:

正如我的好友 Jonathan Stark 所指出的,您应该能够使用自动更正和自动完成等属性来实现您正在寻找的效果:

<input type="text" placeholder="My Field" name="myfield"
    autocapitalize="none" autocorrect="off" autocomplete="off" />

Just tested in OS4 and it's working.

刚刚在 OS4 中测试过,它正在工作。

UPDATE:As of iOS5 onand offvalues in autocapitalizehave been deprecated. Use noneto completely disable automatic capitalization.

UPDATE:iOS5中的作为onoffautocapitalize已弃用。使用none完全禁用自动大写。

回答by Chris Coyier

Actually there is literally a spell check attribute in HTML5:

实际上,HTML5 中有一个拼写检查属性:

<textarea spellcheck="false">

Re: http://blog.whatwg.org/the-road-to-html-5-spellchecking

回复:http: //blog.whatwg.org/the-road-to-html-5-spellchecking

Browser support is, of course, limited.

浏览器支持当然是有限的。