JavaScript 计算器
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<input type="text" id="Demo" name="name" />+
<input type="text" id="clear" name="text"/>
<input type="button" value="=" id="cno" onclick="add()" />
<input type="text" name="name1" id="Demo1" />
<script>
function add(){
var a1=document.getElementById("Demo").value;
var a2=document.getElementById("clear").value;
document.getElementById("Demo1").value=parseInt(a1)+parseInt(a2);
}
</script>
</body>
</html>