/ Published in: JavaScript
http://stackoverflow.com/questions/1484506/random-color-generator-in-javascript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function get_random_color() { var letters = '0123456789ABCDEF'.split(''); var color = '#'; for (var i = 0; i < 6; i++ ) { color += letters[Math.round(Math.random() * 15)]; } return color; }