如何定位提交按钮的禁用状态? [英] How do you target the disabled state of a submit button?

查看:115
本文介绍了如何定位提交按钮的禁用状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看完了,不能想出这一点:你如何定位在css中的禁用状态提交按钮?

I have looked all over and can't figure this out: how do you target the disabled state submit button in css?

例如:我如何定位和设置此按钮的样式:

For example: How would I target and style this button:

<input value="Validate" disabled="disabled" type="submit"/>


推荐答案

您可以使用:

    input[disabled=disabled][type=submit] {
        background:green;
    }

适用于Firefox,据报但IE6。但我没有亲自测试这种组合选择器。

Works on Firefox and is reportedly good on all but IE6. But I haven't personally tested this kind of combo selector.

PS:一个更健壮的跨浏览器方法,使用jQuery ...

PS: A more robust, cross-browser method, using jQuery...

$("input[disabled=disabled][type=submit]").css
({
    'background':   'yellow',
    'color':        'blue'
});

这篇关于如何定位提交按钮的禁用状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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