<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>简易计算器</title>
<style type="text/css">
*{ margin:0; padding:0;}
body{ font-size:12px; color:#333; font-family:"宋体";}
table{ margin:30px auto 0 auto; background:#CFF;}
tr{ height:26px; line-height:26px;}
</style>
</head>
<body>
<form action="#" method="post">
<table width="300">
<tr>
<td> <img src="images/shop.gif" width="54" height="54" /></td>
<td> <strong>购物简易计算器</strong></td>
</tr>
<tr>
<td> 第一个数:</td>
<td>
<input type="text" name="txtCon1" id="txtOne" /></td>
</tr>
<tr>
<td> 第二个数:</td>
<td>
<input type="text" name="txtCon2" id="txtTwo" /></td>
</tr>
<tr>
<td colspan="2">
<input type="button" value=" + "/>
<input type="button" value=" - "/>
<input type="button" value=" * "/>
<input type="button" value=" / "/>
</td>
</tr>
<tr>
<td> 计算结果:</td>
<td> <input type="text" name="txtCom" id="txtCom" /></td>
</tr>
</table>
</form>
</body>
</html>
效果图:
心得:我是一名初学者,希望在JavaScript这方面学得越来越好。也希望我能在编程方面有所成就,这条路我会一直走下去的。我是一名编程员,我也是一名商人。
以利为先,以道为远。——chaoyi
个人E-mail:chaoyi77@163.com