<html>
<head>
<script language ="JavaScript">
<!--
function calc(frm)
{
var num=frm.text1.value
document.form1.text2.value=num + "=" + eval(num)
}
//-->
</script>
</head>
<body>
<form name="form1">
enter an expression then press button:<br>
<input type="text" name ="text1">
<input type="button" value="calculate" onclick="calc(this.form)"><br>
<input type="text" name="text2">
</form>
</body>
</html>