当点击鼠标时,触发鼠标事件,mousedown mouseup click三个事件的触发顺序为mousedown-》mouseup-》click
例:
<!DOCTYPE html> <html> <head> <script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="style.css"> <script> $(document).ready(function(){ $("#one").on("mousedown",function(){ $("#result").append("mousedown"); }); $("#one").on("mouseup",function(){ $("#result").append("mouseup"); }); $("#one").on("click",function(){ $("#result").append("click"); }); }); </script> </head> <body> <p id="result">jQuery Event Handlers</p> <button id="one">button</button> </body> </html>
显示结果为: