Skip to content

Instantly share code, notes, and snippets.

@thedom85
Last active August 29, 2015 14:18
Show Gist options
  • Save thedom85/38eae0e79b26a3c1dea3 to your computer and use it in GitHub Desktop.
Save thedom85/38eae0e79b26a3c1dea3 to your computer and use it in GitHub Desktop.
JQuery_ColorRandom_HtmlDiv
var colors = [ "blue","blue", "red", "yellow", "green", "grey" ];
$("*").find("div").each(function() {
$(this).css("border-color", colors[(Math.floor(Math.random() * (5 - 1 + 1)) + 1)] ).css("border-style","solid").css("border-width","medium");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment