鼠标指针移出 HTML 元素时执行脚本?
鼠标指针移出元素时,onmouseout 属性被触发。你可以尝试以下代码来实现 onmouseout 属性 -
示例
<!DOCTYPE html>
<html>
<body>
<h3 id = "myid" onmouseout = "mouseOut()">
This is demo heading.
</h3>
<p>Click above and then release.</p>
<script>
function mouseOut() {
document.getElementById("myid").style.color = "red";
}
</script>
</body>
</html>
广告
数据结构
网络
关系型数据库管理系统
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP