ComputerEducationWorld.com Categories:
Free Computer Books Online, PHP, PHP 5 Power Programming, C Programming, C For Beginners, Professional C sharp, INDEX - C# Professional in 15 days, Java, Java 2 (simpler way-Old version), Javascript Tutorial for Beginners, HTML, HTML for Beginners, HTML For Advanced, CSS, CSS For Beginners, CSS Advanced, Basic of Computers, Javascript, Free Web Designing Courses, Introduction to JavaScript, Javascript For Beginners, Download Free E-book, .Net, News and Alerts, Ajax, PHP Script, PHP and XML, PHP Ad Management, PHP Classes, MYSQL, Mysql Classes, Mysql Functions, Tips and tricks, Mozilla firefox tricks, Notepad tricks, Windows tricks, MS word tricks, miscellaneous tricks, HTML Tips and Tricks, PHP Tricks, PHP & MySQL, PHP and MySQL - From Beginning to Professional, INDEX, Basic of MySQL, INDEX - MySQL Basic, Wordpress, Wordpress Plugins, Webmasters, Linux/Unix, jQuery
|
Calculator in javascript
|
26 views
-
<script type="text/javascript">function result()
-
{
-
try{
-
document.form1.Input.value= eval(form1.Input.value );
-
}
-
catch(e){
-
alert(‘oops! wrong use of operators’);
-
}
-
}</script>
-
<form>
-
<table border="4">
-
<tbody>
-
<tr>
-
<td>
-
<input name="Input" size="16" type="text" /></td>
-
</tr>
-
<tr>
-
<td>
-
<input onclick="form1.Input.value += ‘1′" name="one" type="button" value=" 1 " />
-
<input onclick="form1.Input.value += ‘2′" name="two" type="button" value=" 2 " />
-
<input onclick="form1.Input.value += ‘3′" name="three" type="button" value=" 3 " />
-
<input onclick="form1.Input.value += ‘ + ‘" name="plus" type="button" value=" + " />
-
-
<input onclick="form1.Input.value += ‘4′" name="four" type="button" value=" 4 " />
-
<input onclick="form1.Input.value += ‘5′" name="five" type="button" value=" 5 " />
-
<input onclick="form1.Input.value += ‘6′" name="six" type="button" value=" 6 " />
-
<input onclick="form1.Input.value += ‘ - ‘" name="minus" type="button" value=" - " />
-
-
<input onclick="form1.Input.value += ‘7′" name="seven" type="button" value=" 7 " />
-
<input onclick="form1.Input.value += ‘8′" name="eight" type="button" value=" 8 " />
-
<input onclick="form1.Input.value += ‘9′" name="nine" type="button" value=" 9 " />
-
<input onclick="form1.Input.value += ‘ * ‘" name="times" type="button" value=" x " />
-
-
<input onclick="form1.Input.value = ”" name="clear" type="button" value=" c " />
-
<input onclick="form1.Input.value += ‘0′" name="zero" type="button" value=" 0 " />
-
<input onclick="result()" name="DoIt" type="button" value=" = " />
-
<input onclick="form1.Input.value += ‘ / ‘" name="div" type="button" value=" / " /></td>
-
</tr>
-
</tbody></table>
-
</form>
|
Post Comment
You must be logged in to post a comment.
|
|