html - Is it Possible to Style a Disabled INPUT element with CSS? -


i need style disabled <select>elements make them they're enabled. can help?

ps. all-too-aware of downsides of doing sort of thing vis vis hci principles etc., requirement i've got if possible ...

thanks.

edit:

@alexthomas' method works when elements disabled in html code unfortunately i'm doing disabling/enabling jquery:

<select class='dayselector'>     <option>monday</option>     <option>tuesday</option>     <!-- .... etc. --> </select>  $(".dayselector").attr("disabled",true);  $(".dayselector").attr("disabled",false); 

so selector:

$(".dayselector")  //works , gets selects 

and

$(".dayselector option")  //works , gets selects' option items 

but
$(".dayselector [disabled='true']") //doesn't return anything.

and

`$(".dayselector [disabled='false']")  //doesn't return anything. 

is there i'm missing?

using jquery:

$('option[disabled="true"]').each(function () {                  $(this).attr('style', 'color:red'); }); 

check in action here http://jsfiddle.net/gfnve


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -