87,910
社区成员
发帖
与我相关
我的任务
分享
<!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>
<script src="jquery.js"></script>
<script>
$(function(){
$(".picture").hover(function(){
$(this).addClass("pictureNew");
},function(){
$(this).removeClass("pictureNew");
})
})
$(document).ready(function(){
var $cr=$("#checkbox");
var cr=$cr[0];
$cr.click(function(){
if($cr.is(":checkd")){
alert("Thank you for your cooperation!");
}
})
})
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>login</title>
<link href="login.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="login-box">
<div class="head">
10秒注册,获得<span class="height">高薪</span>
</div>
<ul class="containt">
<li class="email-box">
邮箱
<input class="email" type="email">
</li>
<li class="password-box">
密码
<input class="password" style=type"password">
</li>
<li class="password2-box">
确认密码
<input class="password2" style=type"password">
</li>
<li class="test-box">
验证码
<input class="test" type="text">
验证码图片
<a href="">换一张</a>
</li>
<li class="reading">
<input class="checkbox" type="checkbox">
我已阅读并同意<a class="book" href="">《**网用户协议书》</a>
</li>
<li class="picture-box">
<a href=""><div class="picture"></div></a>
</li>
</ul>
<div class="foot">
<div class="number">已有账号?请<a href="">直接登录>></a></div>
</div>
</div>
</body>
</html>
$(function(){
$(".picture").hover(function(){
$(this).addClass("pictureNew");
},function(){
$(this).removeClass("pictureNew");
})
$(".checkbox").click(function(){
if(this.checked){
alert("Thank you for your cooperation!");
}
})
})
最好统一写 要么jquery 要么js
checkbox没有ID 所以不能用#checkbox
$cr.is(":checkd") 改成$cr.is(":checked") 细心点。