js6.htm SOURCE The Math Object


This is text field t1. This will be the input field.
Type a number into this field.

This is text field t2. This will be the output field.

These buttons will display F(t1) in t2. F = name of the button.


The calculation gets called by the onClick handlers associated with the buttons.

There is no other <SCRIPT>.

<INPUT TYPE=button NAME="SQRT" VALUE="SQRT" onClick="document.f1.t2.value=Math.sqrt(document.f1.t1.value)">
<INPUT TYPE=button NAME="SIN" VALUE="SIN" onClick="document.f1.t2.value=Math.sin(document.f1.t1.value)">
<INPUT TYPE=button NAME="EXP" VALUE="EXP" onClick="document.f1.t2.value=Math.exp(document.f1.t1.value)">