Showing posts with label calculator. Show all posts
Showing posts with label calculator. Show all posts

Saturday, April 22, 2017

How to create a Simple calculator Using HTML and JavaScript

How to create a Simple calculator Using HTML and JavaScript


Here are the steps to create a simple calculator using HTML and JavaScript which can evaluate simple arithmetic on integer numbers. Two types of inputs text and button are used here on a table within a form element and OnClick event was used to insert button values on the screen or to evaluate the numbers.

Steps to create a Simple calculator Using HTML and JavaScript


1. At first Insert a <form> element within <body> tag.
2. Create a table using <table> .....</table> tag.
3. Insert two types of Input text and button within table data of table row using <tr><td>....</td></tr> tag.
4. Assign OnClick event for all the buttons having numbers and arithmetic operators.
5. Give blank value for Clear(C) button.
6. Use eval() function to evaluate the numbers on OnClick event of equal to sign button.

Full HTML code for a Simple HTML calculator


<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>



Preview of Simple HTML calculator



Related Search Terms

  • Simple Calculator Usnig JavaScript

  • Simple Calculator Usnig HTML

  • How to create a Calculator


Related Posts:


  • How to use Round, Random, Min and Max in JavaSript

  • How to Concatenate, Join and Sort Array in JavaScript?

  • How to Loop Through JavaScript Array?

  • How to Loop using JavaScript?

  • How to Show Pop Up Boxes Using JavaScript?

  • How to Write Conditional Statements in JavaScript?

  • How to Write JavaScript With HTML?

  • How to create Changeable Date and Time Using JavaScript?

  • How to Validate a HTML Form Using JavaScript?

  • How to create a simple form using HTML?

  • How to Create JavaScript Image Slideshow with LInks

  • How to Display Date Format in JavaScript?

  • How to Validate a HTML Form Using JavaScript?

  • What are the Different Ways to Redirect Page in JavaScript?

  • How to Detect Visitors Browser Using JavaScript?

  • How to make rounded corners border using CSS

  • How to Create Custom CSS Template for Printing

  • How to create a simple form using HTML?


Go to link Download

Read more »

Thursday, February 9, 2017

How to Easily Remove Numbers in Calculator app

How to Easily Remove Numbers in Calculator app



For those of you who frequently use the Calculator app on the iPhone for counting, tips this time you should not miss. It should be noted, is meant here is the Calculator app in Apples native applications not third-party applications.

Now try to open the Calculator app on your iPhone or iPod Touch and enter any number. Just type any number, make sure the more than two digits to try this trick. Afterwards, delete the numbers.

You probably are one iDevice user who always uses the Clear to remove the numbers in Calculator app. The way it is considered easy because it could erase the entire number on a screen iPhone without deleting them one by one. But it also means that when you are just one type of the numbers then all the numbers will be erased and you have to type from scratch.

Well, did you know that deleting numbers in Calculator app you can do with a single swipe? Try just swipe from left to right, in the box where the figures before you type. What you are used to?

Exactly! Calculator app will only delete the last digit you type. This is not a trick that is extraordinary as various jailbreak tweaks that are widely available but it would be very important tips for you who often work with numbers :)

Go to link Download

Read more »