html代码:
<div class="detailpwd">
<div class="remempwd" >
<img id="remcheckbox" src="../images/remempwd1.png" />
记住密码</div>
<div class="forgetpwd">忘记密码?</div>
</div>
js代码:
//记住密码复选框点击切换
var toggle = true;
$("#remcheckbox").click(function() {
if (toggle) {
$("img").attr("src", "../images/remempwd2.png")
toggle = false;
} else {
$("img").attr("src", "../images/remempwd1.png")
toggle = true;
}
});