dfa dfa - 1 year ago 67
CSS Question

CSS attribute selector bug in IE8?

as specified by CSS 2.1:

input[type=submit] {
}


or

input[type="submit"] {
}


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?

Answer Source

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

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

Example:

$(':submit').css('color','red');
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download