javascript - 使用另一个单选按钮启用单选按钮

标签 javascript html

当选择父单选按钮时,如何启用子单选按钮?

<body>
  <p>
    <input type="radio" id="bdmain" name="educationalqualification" disabled="true" /> Bachelor's Degree
  </p>
  <ul>
    <li>
       <label>
          <input type="radio" name="bd" disabled="true"/>
                Four Years
       </label>
   </li>
   <li>
      <label>
         <input type="radio"name="bd" disabled="true"/>
                Exceeding Four Years
      </label>
  </li>
  </ul>
</body>

最佳答案

尝试,

$("#bdmain").parent().next("ul").find("input[type='radio']").each(function(){
 $(this).removeAttr("disabled");
});

关于javascript - 使用另一个单选按钮启用单选按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22111522/

相关文章:

c# - 构建一个显示最近更新的网站的 C# 应用程序

javascript - 在 vue.js、quasar 框架中启用复选框检查功能

javascript - D3js 条形图中未定义的 .call()

javascript - 清除表单输入字段

javascript - 读取 video.js 中视频元素/属性的正确方法是什么?

html - 如何在一个 DIV 中重叠两张图像?

HTML 电子邮件 : remove border between <td> buttons in Outlook 2007

javascript - Mootools 和 Lazyload

javascript - 为什么我的 div 在移动时不留在我的另一个 div 上?

android - 存储在 XML 下的编码 HTML