<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>無標(biāo)題頁</title>
<script type="text/javascript">
function test(obj) {
if (obj.id == "Radio1") {/*如果本元素的ID屬性為“radio1”*/
document.getElementById("Div1").style.display = "block";
document.getElementById("Div2").style.display = "none";
}
else {
document.getElementById("Div1").style.display = "none";
document.getElementById("Div2").style.display = "block";
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<ul>
<li>
<input id="Radio1" name="radiobutton" checked="checked" type="radio" onclick="test(this)" /><span>我</span>
</li>
<li>
<input id="Radio2" name="radiobutton" type="radio" onclick="test(this)" /><span>你</span></li>
</ul>
<div id="Div1" class="Image">aaaa</div>
<div id="Div2" class="Image">bbbb</div>
</form>
</body>
</html>
聯(lián)系客服