Created
September 11, 2014 20:01
-
-
Save thornbill/ce4045fc1a0b34ad873b to your computer and use it in GitHub Desktop.
Remove a random rule from a random stylesheet
This file contains hidden or 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
(function(document) { | |
function getRandomInt(max) { | |
return Math.floor(Math.random() * max); | |
} | |
var sheets = document.styleSheets, | |
sheet = sheets[getRandomInt(sheets.length-1)], | |
rules = sheet.cssRules, | |
rule = getRandomInt(rules.length-1); | |
// console.log(rules[rule]); | |
sheet.deleteRule(rule); | |
})(document); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment