2007-02-09 09:20:47 +03:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<style>
|
|
|
|
span { color: green }
|
|
|
|
:default + span { color: red }
|
|
|
|
span.reverse { color: red }
|
|
|
|
:default + span.reverse { color: green }
|
|
|
|
button { display: none }
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<form>
|
|
|
|
<div>
|
|
|
|
<button type="submit" checked="checked" id="foo"></button>
|
|
|
|
<span>There should be no red.</span>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<button type="submit"></button><span class="reverse">There should be no red.</span>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
<script>
|
|
|
|
var foo = document.body.offsetWidth;
|
2007-02-10 00:31:38 +03:00
|
|
|
document.getElementById("foo").setAttribute("type", "button");
|
2007-02-09 09:20:47 +03:00
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|