xxxxxxxxxx
<td><input type="button" value="Calculate" onClick="cal()"/></td>
<html>
<head>
<title>Basic Calculator</title>
<script language="javascript">
function cal()
{
var n1,n2,res,opr;
n1=parseInt(document.getElementById("t1").value);
n2=parseInt(document.getElementById("t2").value);
opr=document.getElementById("s1").value;
switch(opr)
{
case '+':
res=n1+n2;
document.getElementById("t3").value=res;
break;
case '-':
res=n1-n2;
document.getElementById("t3").value=res;
break;
case '*':
res=n1*n2;
document.getElementById("t3").value=res;
break;