两行单选按钮A和B 后面是文本框 当选中A按钮时,A后面的文本框时可编辑。B后面的文本框置灰,不可编辑。当选中B按钮时,B后面的文本框可编辑,A后面的文本框置灰,不可编辑。
求完整代码 谢谢
<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>