日期:2014-05-17 浏览次数:20718 次
<body onload="func()">
<form name="frm">
<input type="radio" checked id="AA" name="radio" value="A" onclick="fun()"/>A
<input type="radio" id="BB" name="radio" value="B" onclick="fun()"/>B
<input type="radio" id="CC" name="radio" value="C" onclick="fun()"/>C
</form>
<div id="A">
A1,A2,A3
</div>
<div id="B">
B1,B2,B3
</div>
<div id="C">
C1,C2,C3。
</div>
</body>
function func(){
$("#B").hide();
$("#C").hide();
}
function fun(){
var temp = $("[name=radio]:input");
if(temp[0].checked){
$("#A").show();
$("#B").hide();
$("#C").hide();
}else if(temp[1].checked){
$("#A").hide();
$("#B").show();
$("#C").hide();
}else if(temp[2].checked){
$("#A").hide();
$("#B").hide();
$("#C").show();
}
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<script src="jquery.min.js" type="text/javascript"></script>
<script src="demo.js" type="text/javascript"></script>
</head>
<body>
<input type="radio" id="a1">A</input>
<input&n