Skip to content

Instantly share code, notes, and snippets.

@lunacodes
Created April 11, 2016 01:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lunacodes/45e2b29f4cd94e36c2dfba2ecc2210f5 to your computer and use it in GitHub Desktop.
Save lunacodes/45e2b29f4cd94e36c2dfba2ecc2210f5 to your computer and use it in GitHub Desktop.
$(document).ready(function() {
var $children = $("#tag_cloud").children("a")
console.log($children)
var $color_list = ['red', 'blue', 'yellow', 'green']
for (i = 1; i < $children.length - 1; i++) {
var $random_color = $color_list[Math.floor(Math.random()*$color_list.length)];
$children[i].css("color", $random_color)
}
console.log(red);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment