类型 事件处理函数 触发条件
click onclick 按下并且释放鼠标
dbclick ondbclick 双击鼠标
mousedown onmousedown 按下鼠标按键
mouseup onmouseup 释放鼠标按键
mousemove onmousemove 移动鼠标
mouseover onmouseover 鼠标进入元素
mouseout onmouseout 鼠标离开元素
<body>
<p id="p" onmousedown="downfunc()" onmouseup="upfunc()">
点我
</p>
</body>
function downfunc() {
document.getElementById("p").innerText = "鼠标已经按下";
}
function upfunc() {
document.getElementById("p").innerText = "鼠标已经释放";
}