标签:div put htm bsp 禁用 javascrip 启用 asc nbsp
radio中最佳解决方案
1、html中
<td>
<input id="status" name="status" type="radio" value="1" checked="checked" onclick="qy()"/>
<span>启用</span>
<input id="status" name="status" type="radio" value="0" onclick="jy()"/>
<span>禁用</span>
</td>
2、js中
function qy(){
$("input[name=‘status‘]").eq(0).attr("checked","checked");
$("input[name=‘status‘]").eq(1).removeAttr("checked");
$(‘input[name="status"]:eq(0)‘).attr("value", 1);
return;
};
function jy(){
$("input[name=‘status‘]").eq(0).removeAttr("checked");
$("input[name=‘status‘]").eq(1).attr("checked","checked");
$(‘input[name="status"]:eq(1)‘).attr("value", 0);
return;
};
标签:div put htm bsp 禁用 javascrip 启用 asc nbsp
原文地址:http://www.cnblogs.com/denied/p/6919368.html