SoFunction
Updated on 2025-04-08

Use RadioButten or CheckBox to realize the display and hide div


<head runat="server">
<title>Use RadioButten (or CheckBox) to realize the display and hide of div</title>
<script type="text/javascript" language="javascript">
function show2() {
if (("Radio2").checked) {
("nvInfo"). = "block";
}
else {
("nvInfo"). = "none";
}
}
</script>
</head>
<body>
<form runat="server">
<div>
<input type="radio" runat="server" name="11" onclick="show2()" value="11" />Male
<input type="radio" runat="server" name="11" onclick="show2()" value="22" />Female
<%-- <input type="checkbox" runat="server" name="11" onclick="show2()" value="22" />Female--%>
</div>
<div runat="server" style="display: none;">
<input type="radio" runat="server" name="2" onclick="show1" value="11" />Beauty
<input type="radio" runat="server" name="2" onclick="show2" value="22" />Talented woman
</div>
</form>
</body>