xxxxxxxxxx
<!DOCTYPE html>
<html>
<title>jQuery mousedown事件示例 - 基础教程(div.cn)</title>
<head>
<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("p").mousedown(function(){
$(this).after("<p style='color:red;'>按下鼠标键</p>");
});
$("p").mouseup(function(){
$(this).after("<p style='color:green;'>鼠标按钮释放</p>");
});
});
</script>
</head>
<body>
<p>按下并释放此段落上的鼠标按钮。</p>
</body>
</html>