Enter an expression, hit enter, and I'll compute the answer

answer

 


<html>

<head>

<script language="javascript">
<!--
function calc(num)
{
document.form1.text2.value=num+"="+eval(num)
}
//-->
</script>
</head>
<body>

<form name="form1">
Enter an expression, hit enter, and I'll compute the answer<br>
<input type ="text" name="text1"
onchange="calc(this.value)"><br>
answer<br>
<input type ="text" name="text2" ><br>

</form>
</body>
</html>