标签:body ++ his onclick on() click -- ret cti
<body>
赞:<button id="btn_zan">0</button>
踩:<button id="btn_cai">0</button>
<script>
function dianZan(){
var i = 0;
return function(){
this.innerHTML ="+"+ ++i;
}
}
btn_zan.onclick = dianZan();
function caiZan(){
var i = 0;
return function(){
this.innerHTML = --i;
}
}
btn_cai.onclick = caiZan();
</script>
</body>
标签:body ++ his onclick on() click -- ret cti
原文地址:http://www.cnblogs.com/wangruifang/p/7376699.html