【前端-raido-设置选中未生效】

html代码

<div class="col-xs-3">
	<label class="radio-inline">
		<input type="radio" name="isEnable" id="isEnable_true" value="true" > 正常
	</label>
	<label class="radio-inline">
		<input type="radio" name="isEnable" id="isEnable_false" value="false"> 禁用
	</label>
</div>

js代码

  $("#isEnable_false").attr("checked",true);或  $("#isEnable_false").attr("checked","checked"); 

设置不生效,html中会添加checked="checked",但仍是未选中状态


解决方法:将attr 改为 prop

猜你喜欢

转载自blog.csdn.net/choushi300/article/details/78528093