html 点击同意,一个id 绑定click事件 做不同的条件判断?

js代码:

//弹窗注册协议

ms=window.parent.document.getElementById('inputzz1');

ks=window.parent.document.getElementById('inputzz');

$('#yes-agree').click(function(){

console.log(ms);

if(!(ms.getAttribute('checked'))){

console.log(123);

$("#inputzz1").attr("checked",true);

$("#check-do1").addClass("check-do-on");

$("button[title='注册']").removeAttr("disabled","disabled").css("background-color","#E4393C");//启用提交按钮

console.log(1234);

}

if(!(ks.getAttribute('checked'))){

$("#inputzz").attr("checked",true);

$("#check-do").addClass("check-do-on");

$(".pt-mid").css({"background-position":"-57px -303px"},

{"width":"175px"},{"height":"33px"});

$("#btnrdz").removeAttr('disabled','disabled');//禁用提交按钮

}

$('.sc-model').fadeOut().html("");

$('.sc-zzc-bg').fadeOut();

});

$('#no-agree').click(function(){

if(ms.getAttribute('checked')){

console.log(123);

$("#inputzz1").attr("checked",false);

$("#check-do1").removeClass("check-do-on");

$("button[title='注册']").attr('disabled','disabled').css("background-color","#ccc");//禁用提交按钮

}

if(ks.getAttribute('checked')){

$("#inputzz").attr("checked",false);

$("#check-do").removeClass("check-do-on");

$(".pt-mid").css({"background-position":"-610px -583px"},

{"width":"175px"},{"height":"33px"});

$("#btnrdz").attr('disabled','disabled');//禁用提交按钮

}

$('.sc-model').fadeOut().html("");

$('.sc-zzc-bg').fadeOut();

});

触发事件html片段:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值