Created
October 31, 2015 20:09
-
-
Save christianmalek/9eeb00143bf92599395c to your computer and use it in GitHub Desktop.
scattergories random category script
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
//just paste this in the debug console | |
function setRandomCategories(categories) { | |
console.clear(); | |
categories = !categories ? 5 : categories; | |
var inputs = $($("table")[2]).find("input"); | |
var max = inputs.length; | |
for (var i = 0; i < categories; i++) { | |
var randIndex = Math.floor(Math.random() * max); | |
$(inputs[randIndex]).prop("checked", true); | |
} | |
} | |
setRandomCategories(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment