blob: e575400408f815f6447785c58b0ce8792197b91d [file] [log] [blame]
<!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>