数字累计

来源:互联网 发布:护理数据价值 编辑:程序博客网 时间:2024/06/11 20:11

<!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=gb2312" />
<title>test</title>
<script type="text/javascript">
 function cd(_this)
 {
  _this.style.display ="";
 }
 function dd(_this)
 {
  _this.style.display ="none";
 }

</script>

<script>
function $(id){
 return document.getElementById(id);
}
function add(s,t){
 test.value=parseInt(s)+t;
 if(test.value>=0&&test.value<=10){

  }else{
  test.value=0
 
}
 
}
</script>

 

 


</head>
<body>
<div onclick="cd(this.nextSibling)">点击</div>
<div style="display:none; position:absolute; width:300px; height:300px; z-index:1000; top:2px; left:3px;background:#ff0" ><span  onclick="dd(this.parentNode)">X</span>
</div>

 


<input name="test" id="test" size="4" value="0"/><input value="+"  type="button" onclick="add(test.value,1)"/><input value="-" type="button" onclick="add(test.value,-1)"/>


</body>
</html>

 

原创粉丝点击