Simple Calculator Program in JavaScript :

Simple Calculator in javascript

Today Friends I Want to tell You How We Create a Simple Calculator 

Program in JavaScript . Here is the easy source code for creating

Simple Calculator Program in Javascript .


 <html>
<head>
<title> Simple Calculator </title>
</head>
<form name="cal">
<table border="2" bgcolor="RED" >
<tr> 
<td>Simple Calculator</td>
</tr>
<tr>
<td>
<input type="text" name="t1" size="20">
<br/>
</td>
</tr>

<tr>
<td>
<input type="button" value="CLEAR" onclick="cal.t1.value = ''">
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<input type="button" value="ADD" onclick="cal.t1.value += ' + '">
<br/>

<input type="button" value="1" onclick="cal.t1.value += '1'">
<input type="button" value="2" onclick="cal.t1.value += '2'">
<input type="button" value="3" onclick="cal.t1.value += '3'">
<input type="button" value="SUB" onclick="cal.t1.value += ' - '">
<br/>

<input type="button" value="4" onclick="cal.t1.value += '4'">
<input type="button" value="5" onclick="cal.t1.value += '5'">
<input type="button" value="6" onclick="cal.t1.value += '6'">
<input type="button" value="MUL" onclick="cal.t1.value += ' * '">
<br/>

<input type="button" value="7" onclick="cal.t1.value += '7'">
<input type="button" value="8" onclick="cal.t1.value += '8'">
<input type="button" value="9" onclick="cal.t1.value += '9'">
<input type="button" value="DIV" onclick="cal.t1.value += ' / '">
<br/>

<input type="button" value="0" onclick="cal.t1.value += '0'">
<input type="button" value="=" onclick="cal.t1.value = eval

(cal.t1.value)">
<input type="button" value="." onclick="cal.t1.value += '.'">
<input type="button" value="MOD" onclick="cal.t1.value += ' % 

'">
<br/>

</td>
</tr>

</table>
</form>
</html>



Step-1. Copy this code and Paste in Notepad .

Step-2. Save it as .html file .

Step-3. Open in any Web browser like Chrome , Firefox , Internet Explorer

             and other. Enjoy With Your Simple Calculator..

Image of Calculator

Thank You To All My Reader :-
Deepak Gupta
www.i-World-Tech.blogspot.in


Related Post :-

1. Batch programming :- How we Create a simple game in batch programming

2. Animated moving car program : computer graphics in c

3. How to Add a Custom Favicon to blogger 

4. How we add a " Find us on facebook " link to blogger 

5. How we add Third Party Gadgets to Blogger :

Comments

  1. nice one, hope for more..

    ReplyDelete
  2. 10nx..stay tuned 4 more update related wd JavaScript

    ReplyDelete
  3. 10nx 4 shring..Cool program of Calculator in javascript..:):)

    ReplyDelete

Post a Comment