How to make a HTML calculator?

Leave a Comment
1.open note pad (winkey+R type "notepad" hit enter)
2.copy the given below code
3.save it to anyname.html like calculator.html
4.open file in your pc browser (Google chrome is best)

code:----------------


<html>
<head>
<title>HTML Calculator</title>
</head>
<body bgcolor= "#0f0499" text= "yellow">
<form name="calculator" >
<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'">
<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'">
<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+='-'">
<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)">
<br>(SHAHRUKH RDX) Solution is <input type="textfield" name="ans" value="">
</form>
 <input type="reset" value="Reset">


</body>
</html>

Search This Blog

Powered by Blogger.

Photo of Admin

Photo of Admin

squre

Ads2

Pages

Ads

Amazon

Ads3

Must Watch for My Subscriber.

Subscribe Via Email

Subscribe to our newsletter to get the latest updates to your inbox. ;-)

Your email address is safe with us!