日期:2014-05-18 浏览次数:20736 次
<html>
<head>
<title>Untitled</title>
<script>
function add(){
var val = document.getElementById("txt").value;
document.getElementById("txt").value = parseInt(val) + 1;
}
</script>
</head>
<body>
<input type="text" name="txt" value="1" />
<input type="button" name="btn" value="+1" onclick="add()" />
</body>
</html>