<input type="button" id="btn" value="点我">

<script>  
var btn = document.getElementById("btn");
btn.addEventListener("mousedown",function(){
console.log("my button mousedown");
});
btn.addEventListener("click",function(){
console.log("my button click");
});
btn.addEventListener("mouseup",function(){
console.log("my button mouseup");
});
</script>

//执行顺序
onmousedown > onmouseup > click
posted on 2018-08-14 14:04  niunf  阅读(171)  评论(0编辑  收藏  举报