编辑下面的代码:【加编码】
<html> <head> <script src="https://libs.baidu.com/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("div,p").mouseenter(function(event){ $("#msg").html("Related target is: " + event.relatedTarget.nodeName); }); }); </script> </head> <body> <div style="height:200px;border:solid">This is a div element <p style="background-color:pink">This is a paragraph</p> </div><br> <div id="msg"></div> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂