为了账号安全,请及时绑定邮箱和手机立即绑定

jquery单选框选中切换问题 java语言

jquery单选框选中切换问题 java语言

慕后森 2018-07-20 11:14:32
两行单选按钮A和B 后面是文本框 当选中A按钮时,A后面的文本框时可编辑。B后面的文本框置灰,不可编辑。当选中B按钮时,B后面的文本框可编辑,A后面的文本框置灰,不可编辑。求完整代码 谢谢
查看完整描述

1 回答

?
慕妹3146593

TA贡献1820条经验 获得超9个赞

 <input type="radio" class="" name="rad" checked="checked" />a:
<input type="text" class="textInput" name="" />
<br/>
<input type="radio" class="" name="rad" />b:
<input type="text" class="textInput" name="" disabled="true" />

<script type="text/javascript">
    $("input[type=radio]").click(function(){
        var ele = $(this);
        $(".textInput").prop("disabled","true");
        ele.next().removeProp("disabled");
    });
</script>


查看完整回答
反对 回复 2018-08-10
  • 1 回答
  • 0 关注
  • 896 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号