我需要风格disabled
<select>
使它们看起来像是已启用的元素。有人可以帮忙吗?
附言。我非常清楚相对于 HCI 原则等来做这类事情的缺点,但这是一个要求,所以如果可能的话我必须这样做......
Thanks.
EDIT:
当 HTML 代码中禁用元素时,@AlexThomas 的方法效果很好,但不幸的是我正在使用 JQuery 进行禁用/启用:
<select class='dayselector'>
<option>Monday</option>
<option>Tuesday</option>
<!-- .... etc. -->
</select>
$(".dayselector").attr("disabled",true);
$(".dayselector").attr("disabled",false);
所以选择器:
$(".dayselector") //works and gets all the selects
and
$(".dayselector option") //works and gets all the selects' option items
but
$(".dayselector [disabled='true']") //doesn't return anything.
and
`$(".dayselector [disabled='false']") //doesn't return anything.
我有什么遗漏的吗?
你可以选择
select[disabled] { }
(
or
select:disabled { }
(
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)