61,112
社区成员
发帖
与我相关
我的任务
分享
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title> 页面名称 </title>
<style type="text/css">
div {
border: 1px solid #999;
width: 500px;
height: 400px;
}
</style>
</head>
<body>
<div id="tid">
<input type="radio" name="test" />
<input type="radio" name="test" />
<input type="radio" name="test" />
<input type="radio" name="test" />
</div>
<script type="text/javascript" src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
$("#tid").click(function(event){
if (!$(event.target).is(":radio"))
$(this).find(":radio").prop("checked",false);
});
</script>
</body>
</html>
<input type=radio disabled name=a>方法1
<input type=radio disabled name=a>方法1
<input type=radio name=b onclick="return false;" checked>方法2
<input type=radio name=b onclick="return false;">方法2