Assign random color to : Color « Style Layout « JavaScript DHTML






Assign random color to

  

<html>
<head>
<title>The Node</title>
<script type="text/javascript">
function randomColor() {
  r=Math.floor(Math.random() * 255).toString(16);
  g=Math.floor(Math.random() * 255).toString(16);
  b=Math.floor(Math.random() * 255).toString(16);
    alert("#"+r+g+b);
}
randomColor();
</script>
<body onload="outputNodeProps(document)">

</body>
</html>

   
    
  








Related examples in the same category

1.Body text Color
2.Foreground Color Example
3.'color' Example
4.Change text color
5.Change element color
6.div.style.color="#fff";