创建一个名为input.html的HTML页面,其中包括一个表单,表单中包含两个文本域,分别供用户输入学号和姓名,该页面也包含提交和重置按钮。
时间: 2024-05-28 09:09:01 浏览: 14
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>输入表单</title>
</head>
<body>
<form>
<label for="student-id">学号:</label>
<input type="text" id="student-id" name="student-id"><br><br>
<label for="name">姓名:</label>
<input type="text" id="name" name="name"><br><br>
<input type="submit" value="提交">
<input type="reset" value="重置">
</form>
</body>
</html>
相关问题
创建一个包含表单的HTML页面
以下是一个简单的包含表单的 HTML 页面示例:
```html
<!DOCTYPE html>
<html>
<head>
<title>表单示例</title>
</head>
<body>
<h1>表单示例</h1>
<form>
<label for="name">姓名:</label>
<input type="text" id="name" name="name"><br><br>
<label for="email">Email:</label>
<input type="email" id="email" name="email"><br><br>
<label for="password">密码:</label>
<input type="password" id="password" name="password"><br><br>
<label for="gender">性别:</label>
<input type="radio" id="male" name="gender" value="male">
<label for="male">男</label>
<input type="radio" id="female" name="gender" value="female">
<label for="female">女</label><br><br>
<label for="country">国家:</label>
<select id="country" name="country">
<option value="china">中国</option>
<option value="usa">美国</option>
<option value="japan">日本</option>
</select><br><br>
<label for="message">留言:</label>
<textarea id="message" name="message"></textarea><br><br>
<input type="submit" value="提交">
<input type="reset" value="重置">
</form>
</body>
</html>
```
在该表单中,我们包含了姓名、Email、密码、性别、国家和留言等字段,并且使用了文本框、单选框、下拉框和文本域等不同的表单元素类型。当用户填写完表单后,可以点击提交按钮将表单内容提交到服务器进行处理。
帮我用html写一个带有多选框和文本域的表单
好的,以下是一个带有多选框和文本域的 HTML 表单示例:
```html
<!DOCTYPE html>
<html>
<head>
<title>多选框和文本域表单</title>
</head>
<body>
<form action="#" method="post">
<p>请选择您喜欢的水果:</p>
<input type="checkbox" name="fruit[]" value="apple">苹果<br>
<input type="checkbox" name="fruit[]" value="banana">香蕉<br>
<input type="checkbox" name="fruit[]" value="orange">橘子<br>
<input type="checkbox" name="fruit[]" value="watermelon">西瓜<br>
<br>
<p>请填写您的意见或建议:</p>
<textarea name="suggestion" rows="5" cols="50"></textarea>
<br><br>
<input type="submit" value="提交">
</form>
</body>
</html>
```
这个表单包含了多个选项的多选框和一个文本域。当用户提交表单时,可以通过服务器端处理 `$_POST['fruit']` 和 `$_POST['suggestion']` 变量来获取用户选择的选项和输入的意见。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://img-home.csdnimg.cn/images/20210720083646.png)
![pptx](https://img-home.csdnimg.cn/images/20210720083543.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)