Wed, 31 Dec 2014 07:16:47 +0100
Revert simplistic fix pending revisit of Mozilla integration attempt.
michael@0 | 1 | <!DOCTYPE html> |
michael@0 | 2 | <html> |
michael@0 | 3 | <head> |
michael@0 | 4 | <style> |
michael@0 | 5 | label {color: red} |
michael@0 | 6 | input[checked]:checked:default ~ label {color: green} |
michael@0 | 7 | input:not([checked]):not(:checked) + label {color: red} |
michael@0 | 8 | </style> |
michael@0 | 9 | </head> |
michael@0 | 10 | <body onload='var form = document.getElementById("form"); |
michael@0 | 11 | var input2 = document.createElement("input"); |
michael@0 | 12 | input2.setAttribute("type", "radio"); |
michael@0 | 13 | input2.setAttribute("id", "two"); |
michael@0 | 14 | input2.setAttribute("checked", "true"); |
michael@0 | 15 | form.insertBefore(input2, form.firstChild); |
michael@0 | 16 | var label2 = document.createElement("label"); |
michael@0 | 17 | label2.setAttribute("for", "two"); |
michael@0 | 18 | var text2 = document.createTextNode("Should be no red"); |
michael@0 | 19 | label2.appendChild(text2); |
michael@0 | 20 | form.insertBefore(label2, document.getElementById("one"));'> |
michael@0 | 21 | <form id="form"> |
michael@0 | 22 | <input type="radio" name="group1" id="one" value="1"/> |
michael@0 | 23 | <label for="one">Should be no red</label> |
michael@0 | 24 | </form> |
michael@0 | 25 | </body> |
michael@0 | 26 | </html> |