用HTML写一个选课页面
时间: 2023-12-19 10:04:47 浏览: 37
以下是一个简单的选课页面的 HTML 代码示例:
``` HTML
<!DOCTYPE html>
<html>
<head>
<title>选课页面</title>
</head>
<body>
<h1>选课页面</h1>
<form action="submit.php" method="post">
<label for="name">姓名:</label>
<input type="text" id="name" name="name" required><br>
<label for="course">课程:</label>
<select id="course" name="course" required>
<option value="">请选择课程</option>
<option value="math">数学</option>
<option value="english">英语</option>
<option value="history">历史</option>
<option value="science">科学</option>
</select><br>
<label for="time">上课时间:</label>
<input type="radio" id="morning" name="time" value="morning" required>
<label for="morning">早上</label>
<input type="radio" id="afternoon" name="time" value="afternoon" required>
<label for="afternoon">下午</label><br>
<label for="comment">备注:</label>
<textarea id="comment" name="comment"></textarea><br>
<input type="submit" value="提交">
</form>
</body>
</html>
```
这个页面包含一个表单,要求用户输入姓名、选择课程、选择上课时间和填写备注,并在提交时将这些信息发送到 submit.php 处理。其中,课程使用了 select 元素,上课时间使用了 radio 元素,而其他的输入则使用了 text 和 textarea 元素。