第一种
<input class="inputcolor"name="site" type="radio" checked="checked" value="1" />正常
<input class="checkedseeond inputcolor" name="site" type="radio" value="2" />停用
$("input[name='site']").eq(1).attr("checked", "checked");
第二种
<div class="content">
<p>用户</p>
<hr class="divider">
<div class="pay">
<input type="radio" name="pay1" value="1">
余额支付
</div>
<div class="pay paystyle">
<input type="radio" name="pay1" value="2" checked="checked">
快捷支付
<img src="<%=basePath%>img/js.jpg">
</div>
</div>
<script>
$(document).ready(function(){
$(".pay").click(function(){
$(this).siblings("div").removeClass("paystyle");
$(this).siblings("div").find("input").prop("checked",false);
$(this).find("input").prop("checked",true);
$(this).addClass("paystyle");
});
});
</script>
第三种
<input type="checkbox" id="selectAll" onclick="checkAll()">全选
function checkAll()
{
var checkedOfAll=$("#selectAll").prop("checked");
alert(checkedOfAll);
$("input[name='procheck']").prop("checked", checkedOfAll);
}