HTML事件属性onmouseout

2018-01-05 13:58 更新

HTML事件属性onmouseout


触发 onmouseout 属性事件当鼠标指针移出元素时。

HTML5中的新功能

没有。

句法

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

支持的标签

所有HTML元素,EXCEPT:

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


浏览器兼容性

onmouseout Yes Yes Yes Yes Yes

例子

<!DOCTYPE html>
<html>
<body>

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

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

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

</body>
</html>

Click to view the demo



以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号