<!DOCTYPE html>
<html>
<head>
<title>HTML Radio Button Example</title>
</head>
<body>
<h2>选择您的性别:</h2>
<form action="">
<input type="radio" id="male" name="gender" value="male">
<label for="male">男</label><br>
<input type="radio" id="female" name="gender" value="female">
<label for="female">女</label><br>
<input type="radio" id="other" name="gender" value="other">
<label for="other">其他</label><br><br>
<input type="submit" value="提交">
</form>
</body>
</html>
<input type="radio"> 用于创建单选按钮。id 属性用于关联 <label> 标签,点击标签时会选中对应的单选按钮。name 属性确保一组单选按钮属于同一组(即一次只能选中一个)。value 属性定义了当表单提交时,所选单选按钮的值。上一篇:html特效
下一篇:html的注释
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站