Example with functions, forms, numbers, reals, calculations and strings
Here you see a function with some statements for calculate some output. This is an interactive programmed calculation program.
<HTML>
<HEAD>
<TITLE>......</TITLE>
<HEAD>
<SCRIPT>
function calc (x)
{
var y,a=6,b=6;
y=a*x+b;
alert (y)
return y
}
</SCRIPT>
<BODY>
xxxx<BR>
xxxx<BR>
xxxx<BR>
<FORM NAME="form6">
<INPUT TYPE="button" VALUE="small programmed calculation" ONCLICK="calc (5)">
</FORM>
xxxx<BR>
xxxx<BR>
xxxx<BR>
</BODY>
</HTML>
Results:
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx
Comments:
You see an interactive programmed calculation program based on the function 'calc'. If the user clicks on the button with the name 'small programmed calculation' the program starts calculation and displaying the output.
The name of the form, 'form6', is not important. In next examples the names of the forms are more important.
Enschede, 8 jan 2001; updated: jan, 28, 2003.