blob: e575400408f815f6447785c58b0ce8792197b91d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>CSSMediaRule deleteRule test</title>
<style id="style1">
@media all {
p { color: red; }
}
</style>
<script>
function test() {
var styleSheet = document.getElementById('style1').sheet;
var mediaRule = styleSheet.cssRules[0];
mediaRule.insertRule("#test { color: green; }", mediaRule.cssRules.length);
}
</script>
</head>
<body onload="test();">
<p id="test">This line should be green.</p>
</body>
</html>
|