Saturday, November 3, 2012

How to Make Simple Browser Calculator

This simple calculator created using javascript, so to open it is by using internet browser (Chrome, Mozilla, Internet Explorer, Opera, Safari, etc).




 
You can create this calculator for online calculator at your blog/website, or you can save it as a html file in your harddisk or USB flashdisk.
Just copy and paste script  below to the HTML/Javascript Gadget  for making online calculator.
Or Copy and paste to  Notepad and save as HTML file for offline calculator.

<FORM NAME="Calculator">
<TABLE BORDER=1>
<TR>
<TD>
<INPUT TYPE="text"   NAME="Input" Size="16">
<br>
</TD>
</TR>
<TR>
<TD>
<INPUT TYPE="button" NAME="one"   VALUE="  1  " OnClick="Calculator.Input.value += '1'">
<INPUT TYPE="button" NAME="two"   VALUE="  2  " OnCLick="Calculator.Input.value += '2'">
<INPUT TYPE="button" NAME="three" VALUE="  3  " OnClick="Calculator.Input.value += '3'">
<INPUT TYPE="button" NAME="plus"  VALUE="  +  " OnClick="Calculator.Input.value += ' + '">
<br>
<INPUT TYPE="button" NAME="four"  VALUE="  4  " OnClick="Calculator.Input.value += '4'">
<INPUT TYPE="button" NAME="five"  VALUE="  5  " OnCLick="Calculator.Input.value += '5'">
<INPUT TYPE="button" NAME="six"   VALUE="  6  " OnClick="Calculator.Input.value += '6'">
<INPUT TYPE="button" NAME="minus" VALUE="  -  " OnClick="Calculator.Input.value += ' - '">
<br>
<INPUT TYPE="button" NAME="seven" VALUE="  7  " OnClick="Calculator.Input.value += '7'">
<INPUT TYPE="button" NAME="eight" VALUE="  8  " OnCLick="Calculator.Input.value += '8'">
<INPUT TYPE="button" NAME="nine"  VALUE="  9  " OnClick="Calculator.Input.value += '9'">
<INPUT TYPE="button" NAME="times" VALUE="  x  " OnClick="Calculator.Input.value += ' * '">
<br>
<INPUT TYPE="button" NAME="clear" VALUE="  c  " OnClick="Calculator.Input.value = ''">
<INPUT TYPE="button" NAME="zero"  VALUE="  0  " OnClick="Calculator.Input.value += '0'">
<INPUT TYPE="button" NAME="DoIt"  VALUE="  =  " OnClick="Calculator.Input.value = eval(Calculator.Input.value)">
<INPUT TYPE="button" NAME="div"   VALUE="  /  " OnClick="Calculator.Input.value += ' / '">
<br>
</TD>
</TR>
</TABLE>
</FORM>


To add in Blogger,
- Go to Layout
- Add a Gadget 
- Look for HTML/JavaScript and paste the script.


For offline calculator
- Open new Notepad
- Copy and Paste the script
- Save as HTML File, for example calculator.html 
( save as type : All Files   Encoding : ANSI )

- Open using browser to run the calculator.



See Also :
Matrix Effect Using Notepad
Swapping Mouse Button Function (right to left , left to right) Using Notepad
How To copy contents from Command Prompt to Notepad or Ms.Word 
How to hide text documents inside Notepad 

Artikel Terkait