四則演算・計算機      
Sample
Calculator
ソース
<HTML>
<BODY>
<CENTER>
<FORM NAME="_calc">
<TABLE BORDER=4 cellpadding =4 bgcolor=black>

<TR>
<TD colspan=4 align=center>
<font color=yellow face="century" size=5><i>Calculator</font>
</TD>
</TR>

<TR>
<TD colspan=4 align=center>
<INPUT TYPE="text"   NAME="Input" Size="22">
</TD>
</TR>
<TR>
<TD><INPUT TYPE="button" VALUE="  1  " OnClick="_calc.Input.value += '1'"></TD><TD>
<INPUT TYPE="button" VALUE="  2  " OnCLick="_calc.Input.value += '2'"></TD><TD>
<INPUT TYPE="button" VALUE="  3  " OnClick="_calc.Input.value += '3'"></TD><TD>
<INPUT TYPE="button" VALUE="  +  " OnClick="_calc.Input.value += ' + '"></TD></TR>
</TR>
<TD><INPUT TYPE="button" VALUE="  4  " OnClick="_calc.Input.value += '4'"></TD><TD>
<INPUT TYPE="button" VALUE="  5  " OnCLick="_calc.Input.value += '5'"></TD><TD>
<INPUT TYPE="button" VALUE="  6  " OnClick="_calc.Input.value += '6'"></TD><TD>
<INPUT TYPE="button" VALUE="  -  " OnClick="_calc.Input.value += ' - '"></TD></TR>
<TR><TD>
<INPUT TYPE="button" VALUE="  7  " OnClick="_calc.Input.value += '7'"></TD><TD>
<INPUT TYPE="button" VALUE="  8  " OnCLick="_calc.Input.value += '8'"></TD><TD>
<INPUT TYPE="button" VALUE="  9  " OnClick="_calc.Input.value += '9'"></TD><TD>
<INPUT TYPE="button" VALUE="  x  " OnClick="_calc.Input.value += ' *'"></TD></TR>
<TR>
<TD><INPUT TYPE="button" VALUE="  C  " OnClick="_calc.Input.value = ''"></TD><TD>
<INPUT TYPE="button" VALUE="  0  " OnClick="_calc.Input.value += '0'"></TD><TD>
<INPUT TYPE="button" VALUE="  =  " OnClick="_calc.Input.value = eval(_calc.Input.value)"></TD><TD>
<INPUT TYPE="button" VALUE="  /  " OnClick="_calc.Input.value += ' / '">
</TD>
</TR>
</TABLE>
</FORM>
</CENTER>
</BODY>
</HTML>
ワンポイント解説
<INPUT TYPE="button" VALUE=" = " OnClick="_calc.Input.value = eval(_calc.Input.value)">
 の1行で、計算をしています。