Created
May 9, 2018 05:31
-
-
Save OlofT/34db29d4052ed1d7ca9f68b9037c412d to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/deyigemuza
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
document = window.document; | |
var styleSheet = document.createElement("style"); | |
styleSheet.setAttribute('type', 'text/css'); | |
var head = document.getElementsByTagName("head")[0]; | |
head.appendChild(styleSheet); | |
styleSheet = document.styleSheets[document.styleSheets.length - 1]; | |
styleSheet.insertRule(".workingClass { dontAddThis }", 0); | |
var rule = styleSheet.cssRules[0]; | |
var style = rule.style; | |
style.borderColor = "green"; | |
console.log("working fine in the browser:"); | |
console.log(rule.cssText); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript"> | |
document = window.document; | |
var styleSheet = document.createElement("style"); | |
styleSheet.setAttribute('type', 'text/css'); | |
var head = document.getElementsByTagName("head")[0]; | |
head.appendChild(styleSheet); | |
styleSheet = document.styleSheets[document.styleSheets.length - 1]; | |
styleSheet.insertRule(".workingClass { dontAddThis }", 0); | |
var rule = styleSheet.cssRules[0]; | |
var style = rule.style; | |
style.borderColor = "green"; | |
console.log("working fine in the browser:"); | |
console.log(rule.cssText);</script></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document = window.document; | |
var styleSheet = document.createElement("style"); | |
styleSheet.setAttribute('type', 'text/css'); | |
var head = document.getElementsByTagName("head")[0]; | |
head.appendChild(styleSheet); | |
styleSheet = document.styleSheets[document.styleSheets.length - 1]; | |
styleSheet.insertRule(".workingClass { dontAddThis }", 0); | |
var rule = styleSheet.cssRules[0]; | |
var style = rule.style; | |
style.borderColor = "green"; | |
console.log("working fine in the browser:"); | |
console.log(rule.cssText); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment