Require the page to implement the Verification code function, click on the "Registration" button, whether or not to complete the registration, the verification code can be automatically refreshed
<script>
function Validtecode ()
{
var codes = new Array (4); //
var colors = new Array ("Red", "Green", "Gray", "Blue", "maroon", "Aqua", "Fuchsia", "Lime", "Olive", "Silver");
for (Var i=0;i < codes.length;i++)
{//
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)]; //
}
}
Document.onload = Validtecode ();
</script>
Page Implementation Verification code function, click the "Register" button, whether or not to complete the registration, the verification code can be automatically refreshed