315920-2c.html (522B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <style> 5 option {color: red} 6 option:disabled {color: green} 7 option[disabled]:not(:enabled) + option {color: green} 8 option:not([disabled]):enabled + option {color: red} 9 </style> 10 </head> 11 <body onload='var elem = document.getElementById("one"); 12 elem.setAttribute("disabled", "disabled");'> 13 <select size="2"> 14 <option id="one">Should be no red</option> 15 <option id="two">Should be no red</option> 16 </select> 17 </body> 18 </html>