<script
language="javascript"
type="text/javascript">
function
sqRt(form)
{
var
number =
form.num.value;
var
ans =
Math.sqrt(number);
form.answer.value
=
ans;
}
function
sqIt(form)
{
var
number =
form.num.value;
var
ans =
eval(number
*
number);
form.answer.value
=
ans;
}
</script>
<form>
<table
border=1>
<tr>
<td>
<input
type=text
name=num
size=10>
</td>
<td>
<input
type=button
value="Sq.
Root"
onClick="sqRt(this.form)"><br>
<input
type=button
value="Square
It"
onClick="sqIt(this.form)">
</td>
<td>
<input
type=text
name=answer
size=15><br>
<input
type=button
value="<--
copy back"
onClick="this.form.num.value
= this.form.answer.value">
</td>
</tr>
</table>
</form>