在jQuery中删除或更改CSS伪类 [英] Removing or altering CSS pseudo class in jQuery
问题描述
一个很简单的问题,所以简短-无论如何,是否有可能使用jQuery删除或更改CSS伪类?或其他任何与此相关的Javascript方法
特别是我想摆脱:专注于输入.我无法以任何方式直接更改CSS文件.
感谢您的帮助
Buster
我不能直接在CSS文件中更改 任何方式.
假设您只能 使用JavaScript来做到这一点,我想不到的任何东西都比:
$('head').append('<style>input:focus{background:#fff}</style>');
您将必须分别重置每个属性. font-weight:normal
,color:#000
-随您所需.
请参见: http://jsfiddle.net/jqpAu/ >
A simple enough question, so briefly - is it possible to remove or alter in anyway a CSS pseudo class using jQuery? Or any other Javascript method for that matter
Specifically I want to get rid of :focus on inputs. I can't alter the CSS file directly in any way.
thanks for any help
Buster
I can't alter the CSS file directly in any way.
Assuming you can only use JavaScript to do this, I can't think of anything better than:
$('head').append('<style>input:focus{background:#fff}</style>');
You will have to individually reset each property. font-weight:normal
, color:#000
- whatever you need.
See: http://jsfiddle.net/jqpAu/
这篇关于在jQuery中删除或更改CSS伪类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!