HTML事件属性onmouseup

HTML事件属性onmouseup


触发 onmouseup 属性事件当鼠标按钮被释放时。

HTML5中的新功能

没有。

句法

<element onmouseup="script or Javascript function name">

支持的标签

所有HTML元素,EXCEPT:

<base>, 
<bdo>, 
<br>, 
<head>, 
<html>, 
<iframe>, 
<meta>, 
<param>, 
<script>, 
<style>, 
<title>


浏览器兼容性

onmouseup Yes Yes Yes Yes Yes

例子

<!DOCTYPE html>
<html>
<body>

<p id="p1" onmouseover="onmouseOver()" onmouseup="mouseUp()">
Click the text! 
</p>

<script>
function onmouseOver() {
    console.log("onmouseOver");
}

function mouseUp() {
    console.log("up");
}
</script>

</body>
</html>

Click to view the demo