- <form action=“” method=“”>:表单
- <label>:标签
- <input type=“” name=“”>:输入
- text:输入文本
- password:输入密码
- checkbox:多选
- radio:单选
- file:上传文件
- submit:提交表单
- <textarea name=“”>:文本框
- <select name=“”>:下拉选择
- <button>:提交按钮
<!DOCTYPE html>
<html>
<head>
<title>task5</title>
</head>
<body>
<form action="" method="post">
<div class="username">
<label>姓名:</label>
<input type="text" name="username" placeholder="用户名"></input>
</div>
<div class="password">
<label>密码:</label>
<input type="password" name="password" ></input>
</div>
<div class="sex">
<label>性别:</label>
<input type="radio" name="sex" value="male" checked></input>男
<input type="radio" name="sex" value="female"></input>女
</div>
<div class="love">
<label>取向:</label>
<input type="radio" name="love" value="male"></input>男
<input type="radio" name="love" value="female" checked></input>女
</div>
<div class="hoppy">
<label>爱好:</label>
<input type="checkbox" name="hoppy" value="data"></input>data
<input type="checkbox" name="hoppy" value="travel" checked></input>旅游
<input type="checkbox" name="hoppy" value="pet" checked></input>宠物
</div>
<div class="comment">
<label>评论:</label>
<textarea name="comment" placeholder="ddd"></textarea>
</div>
<div class="car">
<label>我的car:</label>
<select>
<option value="BMW">BMW</option>
<option value="sabo" selected>萨博</option>
</select>
<button>提交</button>
</div>
</form>
</body>
</html>
Paste_Image.png
网友评论