Skip to content

Instantly share code, notes, and snippets.

@stefanocudini
Created March 25, 2012 12:49
Show Gist options
  • Save stefanocudini/2193416 to your computer and use it in GitHub Desktop.
Save stefanocudini/2193416 to your computer and use it in GitHub Desktop.
html random color
function randcolor() {
function c() {
return Math.floor(Math.random()*220+36).toString(16)
}
return "#"+c()+c()+c();
}
@johnbabu021
Copy link

johnbabu021 commented May 22, 2021

how to use it as a background-color in html page is there any need of using events

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment