
Code
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<p>请输入第一个数字
<input type="text" name="no1">
</p>
<p>
请输入第二个数字
<input type="text" name="no2">
</p>
<p>
<input type="button" name="submit" value="计算" onclick="add()">
</p>
<script language="javascript">
function add()
{
//document.write(document.all.no1.value+"+"document.all.no2.value+"=");
document.write(parseInt(document.all.no1.value) + parseInt(document.all.no2.value));
}
</script>
</body>
</html>
posted @
2009-08-22 14:26
thinkpore
阅读(
77)
评论()
收藏
举报