This is my sample code Thanks a lot for looking at my code:
<!DOCTYPE html>
<html>
<head>
<title>calculator</title>
<style>
</style>
</head>
<body>
<center><h2>calculator</h2></center>
<table border="5px" width="400px" cellspacing="30px" cellpadding="20px" align="center">
<tr>
<td style="border:0;font-style:red"><center><h3>CASIO</h3></center></td>
</tr>
<tr>
<td colspan="3" style="border:0px">
<input type="text" id="txtans" style="width:250px;height:25px;font-size:20px" dir="rtl">
</td>
<td style="background-color:rgb(212, 212, 12)">clear</td>
<td style="background-color:red">on/of</td>
</tr>
<tr>
<td style="background-color:gray">mc</td>
<td style="background-color:gray">mr</td>
<td style="background-color:gray">m-</td>
<td style="background-color:gray">m+</td>
<td style="background-color:gray">HMS</td>
</tr>
<tr>
<td>7</td>
<td>8</td>
<td>9</td>
<td>*</td>
<td style="background-color:cyan">ac</td>
</tr>
<tr>
<td>4</td>
<td>5</td>
<td>6</td>
<td>-</td>
<td>%</td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td rowspan="2">+</td>
<td>/</td>
</tr>
<tr>
<td>0</td>
<td>+/-</td>
<td>.</td>
<td>=</td>
</tr>
</table>
</body>
</html>
Please help me add "button" functionality in this code so that when I run this program in my browser I can click the number buttons and work on calculation!
Aucun commentaire:
Enregistrer un commentaire