拼写检查禁用CSS而不是HTML [英] Spellcheck disable with CSS not HTML
本文介绍了拼写检查禁用CSS而不是HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在Chrome / Safari中使用CSS停用拼字检查功能。在HTML spellcheck =false
工作,但我想这样做,将影响所有输入字段。我尝试了 input {spellcheck:disabled}
,但是没有成功。
I want to disable spellchecking in Chrome/Safari using CSS. In HTML spellcheck="false"
works but I want to do this in a way that will affect all input fields. I tried input{spellcheck: disabled}
but this didn't work.
推荐答案
使用jQuery。例如:
use jQuery. Something like:
$(document).ready( function() {
$("input[type='text'], textarea").attr('spellcheck',false);
});
这应该搜索页面上的所有文本框和teatarea的,并添加属性 spellcheck =false
给他们。
This should search for all textbox's and teatarea's on the page and add the attribute spellcheck="false"
to them.
这篇关于拼写检查禁用CSS而不是HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文