标签:
<input type="checkbox" id="new_check" onChange="noUse()" checked>
<input type="button" class="new_login_btn2" id="new_login">
<script>
var new1=document.getElementById("new_check");
var new2=document.getElementById("new_login");
function noUse(){
if(new1.checked){
new2.disabled=false;
new2.className=‘new_login_btn2‘;
}
else{
new2.disabled=true;
new2.className=‘new_login_no‘;
}
}
</script>
【学习】原生js学习笔记1:添加class和使input为不可用
标签:
原文地址:http://www.cnblogs.com/xiaoxianweb/p/5692529.html