87,996
社区成员




<tr>
<td>共有情况</td>
<td colspan="5" align="left"><input type="checkbox" name="ownerType" id="ownerType" value=" 单独所有"/> 单独所有 <input type="checkbox" name="ownerType" id="ownerType" value=" 按份共有"/> 按份共有(所占份额: %) <input type="checkbox" name="ownerType" id="ownerType" value="共同共有"/> 共同共有</td>
</tr>
<html>
<head>
<script type="text/javascript">
function choose(){
var chks = document.getElementsByName("ownerType");
for(var i = 0 ,len = chks.length;i < len ; i++){
if(chks[i].value == "按份共有"){
chks[i].checked = "checked";
}
}
}
</script>
<head/>
<body>
<label for="chk1">单独所有</label>
<input type="checkbox" name="ownerType" id="chk1" value="单独所有"/>
<br/>
<label for="chk2">按份共有</label>
<input type="checkbox" name="ownerType" id="chk2" value="按份共有"/>
<br/>
<label for="chk3">共同共有</label>
<input type="checkbox" name="ownerType" id="chk3" value="共同共有"/>
<br/>
<button onclick="choose()">choose</button>
</body>
</html>
$(function(){
//比如有个button是获取这个'共同共有'字符串的
$("#btn").click(function(){
if($(this).val() == '共同共有'){
//假如你的table的id是tab
$("#tab input:checkbox").each(function(){
if($(this).val() == '共同共有'){
$(this).attr('checked',true);
}
})
}
})
});