单选框组

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
body {
    background: url(images/bg.jpg) no-repeat;
    padding: 0;
    margin: 0;
    width: 1003px;
    height: 1056px;
}
#apDiv1 {
    position: absolute;
    width: 225px;
    height: 18px;
    z-index: 1;
    left: 182px;
    top: 239px;
}
</style>
</head>

<body>
<div id="apDiv1">
<form id="form1" name="form1" method="post" action="">
    <input type="radio" name="radio" id="radio" value="radio">
    <label for="radio">男</label>
    <input type="radio" name="radio2" id="radio2" value="radio2">
    <label for="radio2">女</label>
</form>
</div>
</body>
</html>

input的name定义一样的时候,就会成立一个单选框组,提交表单的时候,服务端就会接收你选中的单选框

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容