💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
**mouseleave()** 当鼠标指针离开元素时,会发生 mouseleave 事件。 [mouseleave() 方法](https://www.w3cschool.cn/jquery/event-mouseleave.html)触发 mouseleave 事件,或规定当发生 mouseleave 事件时运行的函数: ``` <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>W3Cschool教程(w3cschool.cn)</title> <script src="//libs.baidu.com/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("#p1").mouseleave(function(){ alert("再见,您的鼠标离开了该段落。"); }); }); </script> </head> <body> <p id="p1">这是一个段落。</p> </body> </html> ```