Java script Calculator

17May10

this is calculator


Code for calculator is

<html>
<body>
<table>
<form name=”b”>
<tr>
<td colspan=”3″ align=”center”><input type=”text” name=”a” >
<tr><td><input type=”button” value=” 1 ” onClick=”document.b.a.value+=1″><td><input type=”button” value=” 2 ” onClick=”document.b.a.value+=2″><td><input type=”button” value=” 3 ” onClick=”document.b.a.value+=3″></tr>
<tr><td><input type=”button” value=” 4 ” onClick=”document.b.a.value+=4″><td><input type=”button” value=” 5 ” onClick=”document.b.a.value+=5″><td><input type=”button” value=” 6 ” onClick=”document.b.a.value+=6″></tr>
<tr><td><input type=”button” value=” 7 ” onClick=”document.b.a.value+=7″><td><input type=”button” value=” 8 ” onClick=”document.b.a.value+=8″><td><input type=”button” value=” 9 ” onClick=”document.b.a.value+=9″></tr>
<tr><td><input type=”button” value=” 0 ” onClick=”document.b.a.value+=0″><td><input type=”button” value=” + “onClick=”document.b.a.value+=’+'”><td><input type=”button” value=” – “onClick=”document.b.a.value+=’-'”></tr>
<tr><td><input type=”button” value=” /  ” onClick=”document.b.a.value+=’/'”><td><input type=”button” value=” * ” onClick=”document.b.a.value+=’*'”><td><input type=”button” value=” = ” onClick=”document.b.a.value=eval(document.b.a.value);”>
<tr><td><input type=”reset” value=” C ” ><td>
</table>
</body>
</html>
Advertisement


No Responses Yet to “Java script Calculator”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.