<h2 align=center>小小计算器</h2><hr>
<form>
<table width="400" border="0" align="center" cellpadding="3" cellspacing="3" bgcolor="#B7B7B7">
<tr bgcolor="#FFFFFF">
<td>请输入底数:</td>
<td><input type="text" name="textfield"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td>请输入幂数:</td>
<td><input type="text" name="textfield"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><input name="button" type="button" id="button" value="计算结果为" onclick="document.forms[0].elements[3].value=Math.pow(document.forms[0].elements[0].value,document.forms[0].elements[1].value);"></td>
<td><input type="text" name="textfield"></td>
</tr>
</table>
</form>
不过呢
这么多代码也就只有一句有用
其实它就是练习一下Math对象的一些方法
Math.pow(val1,power);