鼠标指针移出 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>
广告