315920-28c.html (962B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <style> 5 optgroup {color: red} 6 option {color: red} 7 optgroup[disabled]:disabled {color: green} 8 optgroup[disabled]:disabled + optgroup:not([disabled]):not(:disabled) {color: blue} 9 optgroup[disabled]:disabled > option{color: green} 10 optgroup:not([disabled]):not(:disabled) > option {color: blue} 11 </style> 12 </head> 13 <body onload='document.getElementById("ogtwo").removeAttribute("disabled"); 14 document.getElementById("ogone").setAttribute("disabled", "disabled");'> 15 <select size="7"> 16 <optgroup id="ogone" label="opt group 1"> 17 <option id="one">Should be no red</option> 18 <option id="two">Should be no red</option> 19 </optgroup> 20 <optgroup id="ogtwo" label="opt group 2" disabled="disabled"> 21 <option id=three>Should be no red</option> 22 <option id=four>Should be no red</option> 23 </optgroup> 24 </select> 25 </body> 26 </html>