Textarea 拼写检查属性 XHTML Strict

发布于 2024-08-16 01:35:02 字数 219 浏览 2 评论 0原文

我想在包含 HTML 嵌入代码供访问者复制和粘贴的文本区域上关闭某些浏览器(例如 Firefox 和 Opera)中的内置拼写检查功能。这可以通过以下属性来完成:

spellcheck="false"

但是,这会导致 XHTML Strict 的验证错误。此外,它在 Opera 中也无法正常工作,因为在用户在文本区域中选择嵌入代码后,拼写检查会返回。是否有另一种方法可以关闭拼写检查功能?

I would like to turn off the built-in spellcheck functionality in certain browsers such as Firefox and Opera on a textarea that contains HTML embed code for visitors to copy and paste. This can be done with following attribute:

spellcheck="false"

However, this causes a validation error for XHTML Strict. Also, it doesn't work properly in Opera, because the spell checking returns after a user selects the embed code in the text area. Is there another method for turning off spell check functionality?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

蹲在坟头点根烟 2024-08-23 01:35:03

spellcheck="false"HTML5 规范。您不介意以适当的方式更改您的文档类型吗?

这个问题中提出的另一个想法是使用第三方所见即所得编辑器t 使用文本字段进行用户输入。

spellcheck="false" is a part of HTML5 specification. Don't you mind changing your doctype in appropriate way?

Another idea proposed in this question is using third-party WYSIWYG editors that don't use textfield for user input.

不知所踪 2024-08-23 01:35:03
 $("#id").attr("spellcheck",false);
 $("#id").attr("spellcheck",true);
 $("#id").attr("spellcheck",false);
 $("#id").attr("spellcheck",true);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文