好多人都没写投票总数?
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
.con {
width: 200px;
height: 200px;
background: red;
}
.tou {
width: 200px;
height: 30px;
line-height: 30px;
background: #a7cbff;
}
.tou button {
float: left;
}
.tou .ret {
float: right;
}
</style>
<script type="text/javascript">
function vote(e){
var a=document.getElementById('total');
var num=parseInt(a.innerHTML)+1;
a.innerHTML=num;
disable(e);
}
function disable(e){
e.disabled=true;
setTimeout(function(){
e.disabled=false;
},5000);
}
</script>
</head>
<body>
<div class="con">投票内容</div>
<div class="tou">
<button onclick="vote(this)">投票</button>
<span class="ret">总票数:<span id="total">0</span></span>
</div>
</body>
</html>