<HEAD> <TITLE>Example 5</TITLE> <SCRIPT LANGUAGE="JavaScript"> <!-- var n,t; function question(){ n=prompt("number?",""); if(n==null) return; n=parseFloat(n); t=setTimeout("clearTimeout(t);dispbin(0)",200); return; } function dispbin(x){ var i; for(i=0;i<4;i++){ if(x%Math.pow(2,4-i)>=Math.pow(2,3-i)) document.forms[0].elements[i].checked=true; else document.forms[0].elements[i].checked=false; } x++; if(x<=n) t=setTimeout("clearTimeout(t);dispbin("+x+")",200); else question(); return; } //--> </SCRIPT> </HEAD> <BODY onLoad="question()"> <H1>Example 5</H1> <FORM> <INPUT TYPE=CHECKBOX> <INPUT TYPE=CHECKBOX> <INPUT TYPE=CHECKBOX> <INPUT TYPE=CHECKBOX> </FORM> </BODY>