0% found this document useful (0 votes)
3 views

Calc

This document contains the HTML code for a simple calculator interface. It includes buttons for digits 0-9, basic arithmetic operations, a clear button, and an equals button to evaluate expressions. The calculator utilizes JavaScript to update the display and perform calculations based on user input.

Uploaded by

helena
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Calc

This document contains the HTML code for a simple calculator interface. It includes buttons for digits 0-9, basic arithmetic operations, a clear button, and an equals button to evaluate expressions. The calculator utilizes JavaScript to update the display and perform calculations based on user input.

Uploaded by

helena
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

<html>

<head>
</head>
<body> <h3>Simple Calculator</h3> <br/>
<form Name="calc"> <table border=2>
<tr> <td colspan=4><input type=text Name="display"></td> </tr>
<tr> <td><input type=button value="0" OnClick="calc.display.value+='0'"></td>
<td><input type=button value="1" OnClick="calc.display.value+='1'"></td>
<td><input type=button value="2" OnClick="calc.display.value+='2'"></td>
<td><input type=button value="+" OnClick="calc.display.value+='+'"></td> </tr>
<tr> <td><input type=button value="3" OnClick="calc.display.value+='3'"></td>
<td><input type=button value="4" OnClick="calc.display.value+='4'"></td>
<td><input type=button value="5" OnClick="calc.display.value+='5'"></td>
<td><input type=button value="-" OnClick="calc.display.value+='-'"></td> </tr>
<tr> <td><input type=button value="6" OnClick="calc.display.value+='6'"></td>
<td><input type=button value="7" OnClick="calc.display.value+='7'"></td>
<td><input type=button value="8" OnClick="calc.display.value+='8'"></td>
<td><input type=button value="x" OnClick="calc.display.value+='*'"></td>
</tr> <tr> <td><input type=button value="9" OnClick="calc.display.value+='9'"></td>

<td><input type=button value="C" OnClick="calc.display.value=''"></td>


<td><input type=button value="="
OnClick="calc.display.value=eval(calc.display.value)"></td>
<td><input type=button value="/" OnClick="calc.display.value+='/'"></td>
</tr> </table> </form> </body> </html>

You might also like