<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<script type="text/javascript" src="js/jquery-2.1.4.js"></script>
<script language="javascript" type="text/javascript">
$(function() {
$(document).mousemove(function(e) {
$("span").html("X:" + e.pageX + "Y:" + e.pageY + "事件" + e.type);
});
});
</script>
</head>
<body>
<span></span>
</body>
</html>
按A
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<script type="text/javascript" src="js/jquery-2.1.4.js"></script>
<script language="javascript" type="text/javascript">
$(function() {
$(document).keydown(function(e) {
$('span').html(e.which);
})
});
</script>
</head>
<body>
<span></span>
</body>
</html>