编辑下面的代码:【加编码】
<html> <head> <script src="https://libs.baidu.com/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("div").mouseup(function(){ $(this).after("<p style='color:green;'>Mouse button released.</p>"); }); $("div").mousedown(function(){ $(this).after("<p style='color:purple;'>Mouse button pressed down.</p>"); }); }); </script> </head> <body> <div>Press down and release the mouse button over this div element.</div> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂