IE8中的CSS属性选择器错误? [英] CSS attribute selector bug in IE8?

查看:133
本文介绍了IE8中的CSS属性选择器错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CSS 2.1 指定:

input[type=submit] {
}

input[type="submit"] {
}

必须匹配type属性值完全等于submit的任何输入元素。但是,此选择器不适用于IE8(和IE7兼容模式)。
任何提示?解决方法?

must matches any input element whose "type" attribute value is exactly equal to "submit". However this selector doesn't works on IE8 (and IE7 compatibility mode). Any hint? workarounds?

推荐答案

jQuery会为您提供所需的选择器,而不需要肮脏的hacks。

jQuery will give you the selectors you need without dirty hacks.

$(':submit').css( 'styleprop', 'value' );

示例:

$(':submit').css('color','red');

这篇关于IE8中的CSS属性选择器错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆