html表单

1.Text Fields

<form>
First name: <input type="text" name="firstname"><br>

Password: <input type="password" name="pwd">
</form>

2.Radio Buttons  name必须一样才能实现单选

<form>
<input type="radio" name="sex" value="male">Male<br>
<input type="radio" name="sex" value="female" checked="checked">Female
</form>

3.Checkboxes

<form>
<input type="checkbox" name="vehicle" value="Bike">I have a bike<br>
<input type="checkbox" name="vehicle" value="Car">I have a car 
</form>

4.下拉框

<select name="cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="fiat">Fiat</option>
<option value="audi">Audi</option>
</select>

5.文本框

<textarea rows="10" cols="30">
我是一个文本框。
</textarea>

6.按钮

<input type="button" value="Hello world!">

<input type="submit" value="Hello world!">

7.边框的表单

<fieldset>相关表单元素
<legend>Personal information:</legend>元素标题
Name: <input type="text" size="30"><br>
E-mail: <input type="text" size="30"><br>
Date of birth: <input type="text" size="10">
</fieldset>

原文地址:https://www.cnblogs.com/huoran1120/p/5941825.html