Note: Copy the following code to produce an effect.
<title> Untitled Page </title>
<body>
<form id= "Form1" runat= "Server" >
<div>
<div id= "Divcode" style= "background-color:white; width:52px; height:16px; padding:5px; Text-align:center; Vertical-align:middle; letter-spacing:5px; Border:solid 1px Blue "><span></span><span ></span><span ></span><span ></span></div>
</div>
<input id= "Button1" type= "button" value= "for another" onclick= "Javascript:validtecode ()"/>
</form>
</body>
<script language= "JavaScript" type= "Text/javascript" >
function Validtecode ()
{
var codes = new Array (4); For storing random authentication codes
var colors = new Array ("Red", "Green", "Gray", "Blue", "maroon", "Aqua", "Fuchsia", "Lime", "Olive", "Silver");
for (Var i=0;i < codes.length;i++)
{//Get random Authentication Code
Codes[i] = Math.floor (Math.random () *10);
}
var spans = document.getElementById ("Divcode"). All;
for (Var i=0;i<spans.length;i++)
{
Spans[i].innerhtml=codes[i];
Spans[i].style.color = Colors[math.floor (Math.random () *10)]; Randomly set Authenticode color
}
}
Document.onload = Validtecode ();
</script>