blob: 5264e76ab61d20e5334caa0bb9c1392795b37123 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
<!DOCTYPE html>
<html>
<head>
<style>
span { color: red }
:checked + span { color: green }
input { display: none }
</style>
</head>
<body>
<input checked="checked" id="foo"><span>There should be no red</span>
<script>
var foo = document.body.offsetWidth;
document.getElementById("foo").setAttribute("type", "checkbox");
</script>
</body>
</html>
|