例子:单选按钮确定提交是否可用

<div style="500px; height:500px;">
 <div style="margin-top:20px;">
     <input type="radio" name="sure" id="s1" onclick="KeYong()" />同意
        <input type="radio" name="sure" id="s2" onclick="BuKeYong()" />不同意
    </div>
    <div style="margin-top:30px">
     <input type="submit" value="确定" id="btn" style="100px; height:35px;" disabled="disabled" />
    </div>
</div>

<script type="text/javascript">
   function KeYong()
 {
    //找到按钮
    var a = document.getElementById("btn");
  
    //操作按钮属性
    a.removeAttribute("disabled");
 }
   function BuKeYong()
 {
    var a = document.getElementById("btn");
    a.setAttribute("disabled","disabled");
 }
</script>

原文地址:https://www.cnblogs.com/l5580/p/5909013.html