
Hi, In this post we will see how to generate random colors using JavaScript. We will generate a random color and change the color of the div contents, at regular intervals.
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Generate Random Colors using JavaScript</title>
<script type="text/javascript">
// after every second timer
setInterval(randomRgb, 1000);
function randomRgb() {
// create the rgb string
var col = "rgb("
+ randomColor(255) + ","
+ randomColor(255) + ","
+ randomColor(255) + ")";
//change...