<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<style type="text/css">
.highlight{
background:#FF3300;
}
</style>
<script src="../js/jquery-1.8.3.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
$("html").mousedown(function(){
if(event.which==2){
alert("我点了滚动按钮")}
if(event.which==1){
alert("我左击了")}
if(event.which==3){
alert("我右击了")}
})
$("#sub").click(function(){
alert(event.pageX+","+event.pageY);
var name=$("#text").val();
if(""==name){
$("#mm").html("*用户名不能为空");
return false;
}
})
})
</script>
<body>
<form>
用户名:<input type="text" name="text" id="text" /><div id="mm"></div>
密 码:<input type="password" name="password" id="password" />
<input type="submit" value="提交" id="sub" />
</form>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<style type="text/css">
.highlight{
background:#FF3300;
}
</style>
<script src="../js/jquery-1.8.3.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
$("html").mousedown(function(){
if(event.which==2){
alert("我点了滚动按钮")}
if(event.which==1){
alert("我左击了")}
if(event.which==3){
alert("我右击了")}
})
$("#sub").click(function(){
alert(event.pageX+","+event.pageY);
var name=$("#text").val();
if(""==name){
$("#mm").html("*用户名不能为空");
return false;
}
})
})
</script>
<body>
<form>
用户名:<input type="text" name="text" id="text" /><div id="mm"></div>
密 码:<input type="password" name="password" id="password" />
<input type="submit" value="提交" id="sub" />
</form>
</body>
</html>