用Html和Javascript实现计算器

<html>

<head>

<title></title>

</head>

<body>

<input type="text" name="no1">

<input type="text" name="no2">

<input type="button" name="submit" value="calculator" onclick="add()" >

 

<script language="javascript">

function add()

{

document.write(parseInt(document.all.no1.value)+parseInt(document.all.no2.value));

}

</script>

</body>

</html>

posted @ 2007-08-09 16:24  许晓光  阅读(1085)  评论(0编辑  收藏  举报