同意 注册

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>

<input type="checkbox" id="ck" onClick="xiugai()"/>同意
<input type="button" value="注册" id="btn" disabled="disabled" />


</body>
<script type="text/javascript">
function xiugai()
{
    //找到复选框
    var ck=document.getElementById("ck");
    //找到按钮
    var btn=document.getElementById("btn");
    //判断复选框的选中状态
    if(ck.checked)
    {
        //移除按钮的不可用属性
        btn.removeAttribute("disabled");
    }
    else
    {
        //设置不可用属性
        btn.setAttribute("disabled","disabled");
    }   
}
</script>


</html>
原文地址:https://www.cnblogs.com/aqxss/p/6053011.html