<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Platform</title>
</head>
<script type="text/javascript">
function genderShow(){
if(document.getElementById("male").checked)
{
alert(document.getElementById("male").value);
}
if(document.getElementById("female").checked){
alert(document.getElementById("female").value);
}
}
</script>
<body >
<div>
<ul>sex:
<li>man:<input type="radio" id="male" name="sex" value="man"/></li>
<br/>
<li>woman:<input type="radio" id="female" name="sex" value="woman"/></li>
<br/>
</ul>
<button οnclick="genderShow()">showGender</button>
</div>
</body>
</html>
html radio 是否选中的判断
最新推荐文章于 2024-09-23 15:41:12 发布