calc.html 1.41 KB
Newer Older
nishanth's avatar
nishanth committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
<html>
<head>
<title>calculator</title>
</head>
<body bgcolor= "#000000" text= "gold">
<form name="calculator" >
Solution is<br>
<input type="textfield" name="ans" value=""><br>

<input type="button" value="1" onClick="document.calculator.ans.value+='1'">
<input type="button" value="2" onClick="document.calculator.ans.value+='2'">
<input type="button" value="3" onClick="document.calculator.ans.value+='3'">
<input type="button" value="4" onClick="document.calculator.ans.value+='4'"><br>
<input type="button" value="5" onClick="document.calculator.ans.value+='5'">
<input type="button" value="6" onClick="document.calculator.ans.value+='6'">
<input type="button" value="7" onClick="document.calculator.ans.value+='7'">
<input type="button" value="8" onClick="document.calculator.ans.value+='8'"><br>
<input type="button" value="9" onClick="document.calculator.ans.value+='9'">
<input type="button" value="0" onClick="document.calculator.ans.value+='0'">
<input type="button" value="-" onClick="document.calculator.ans.value+='-'">
<input type="button" value="+" onClick="document.calculator.ans.value+='+'"><br>
<input type="button" value="*" onClick="document.calculator.ans.value+='*'">
<input type="button" value="/" onClick="document.calculator.ans.value+='/'">
 


<input type="button" value="=" onClick="document.calculator.ans.value=eval(document.calculator.ans.value)">
<input type="reset" value="Reset">
<br>
</form>
</body>
</html>