<HTML> <HEAD> <TITLE>Test Input</TITLE> <style type="text/css"> <!-- .box { color: #060; } .box input { background-image: url(back.jpg); background-repeat: repeat-x; font-color: white; font-weight: bold; border: 1px solid black; } } --> </style> <SCRIPT LANGUAGE="JavaScript"> var testD=document.getElementById('display2').value; var testVar=document.getElementById('display').value; if(Number(testVar) > 50) { parseInt(testVar); parseInt(testD); testVar = (Number(testVar)+Number(10)); testD = testVar; } else if(Number(testVar) > 45 && Number(testVar) < 51) { parseInt(testVar); parseInt(testD); testVar = (Number(testVar)+Number(9)); testD = testVar; } else if(Number(testVar) > 40 && Number(testVar) < 46) { parseInt(testVar); parseInt(testD); testVar = (Number(testVar)+Number(8)); testD = testVar; } else if(Number(testVar) > 35 && Number(testVar) < 41) { parseInt(testVar); parseInt(testD); testVar = (Number(testVar)+Number(7)); testD = testVar; } else if(Number(testVar) > 30 && Number(testVar) < 36) { parseInt(testVar); parseInt(testD); testVar = (Number(testVar)+Number(6)); testD = testVar; } else if(Number(testVar) > 25 && Number(testVar) < 31) { parseInt(testVar); parseInt(testD); testVar = (Number(testVar)+Number(5)); testD = testVar; } else if(Number(testVar) > 20 && Number(testVar) < 26) { parseInt(testVar); parseInt(testD); testVar = (Number(testVar)+Number(4)); testD = testVar; } else if(Number(testVar) > 15 && Number(testVar) < 21) { parseInt(testVar); parseInt(testD); testVar = (Number(testVar)+Number(3)); testD = testVar; } else if(Number(testVar) > 10 && Number(testVar) < 16) { parseInt(testVar); parseInt(testD); testVar = (Number(testVar)+Number(2)); testD = testVar; } else if(Number(testVar) > 5 && Number(testVar) < 11) { testD = testVar; testD++; } else { var testD = Number(testVar); } document.getElementById('display2').value=testD; } </SCRIPT> </HEAD> <BODY> Enter something in the box: <BR><P> <div class="box"> <font color=""> <input name="display" style="text-align: center; width: 50px;" value=""> <input style="text-align: center; width:50px;; " value="0" name="display2"> <input type="button" name="button" style=";" value="Click" onClick="calc()"></font></div> </BODY> </HTML>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)