How to make a SIMPLE CALCULATOR USING HTML without using Javascript
Learn to Make a Simple CALCULATOR in just 2 minutes with HTML without using JavaScript or CSS.
(2 minutes coding)Steps to make your own calculator
1. Open NOTEPAD or NOTEPAD++ in your computer .
2. Copy the code given below .
<html><head>
<title>HTML Calculator</title>
</head>
<body alignment="center" bgcolor= "black" text= "RED">
<H1 >CALCULATOR</H1>
<form name="calculator" >
<input type="button" value="1" onClick="document.calculator.display.value+='1'">
<input type="button" value="2" onClick="document.calculator.display.value+='2'">
<input type="button" value="3" onClick="document.calculator.display.value+='3'">
<br>
<input type="button" value="4" onClick="document.calculator.display.value+='4'">
<input type="button" value="5" onClick="document.calculator.display.value+='5'">
<input type="button" value="6" onClick="document.calculator.display.value+='6'">
<br>
<input type="button" value="7" onClick="document.calculator.display.value+='7'">
<input type="button" value="8" onClick="document.calculator.display.value+='8'">
<input type="button" value="9" onClick="document.calculator.display.value+='9'">
<br>
<input type="button" value="0" onClick="document.calculator.display.value+='0'">
<input type="button" value="-" onClick="document.calculator.display.value+='-'">
<input type="button" value="+" onClick="document.calculator.display.value+='+'">
<br>
<input type="button" value="*" onClick="document.calculator.display.value+='*'">
<input type="button" value="/" onClick="document.calculator.display.value+='/'">
<input type="button" value="=" onClick="document.calculator.display.value=eval(document.
calculator.display.value)">
<br>
<input type="reset" value="Reset">
Result <input type="textfield" name="display" value="">
</form>
</body>
</html>
3. Now paste it in your Notepad file.
3. Now save your file with .html extension.
4. File will appear like this.
5. Now open the file in any browser except internet explorer.






Comments
Post a Comment