赞
踩
表单
表单标签共有4个:<input>、<textarea>、<select>和<option>。其中<select>和<option>是配合使用的。
我们通过一张表单来把所有input标签囊括:
(一)、input标签表单
大部分表单都是用input标签完成的。
语法:
<input type="表单类型"/>
说明:
表1中的表单都是使用input标签,所不同的就是type属性值不同。
(二)、textarea标签表单
(1)、多行文本框
语法:
<textarea rows="行数" cols="列数">多行文本框内容</textarea>
表现形式如下:
(2)、3种文本框对比
单行文本框和密码文本框使用<input>标签,而多行文本框使用<textarea>标签。
①单行文本框
语法:
<input type="text" value="默认文字" size="文本框长度" maxlength="最多输入字符数"/>
①密码文本框
语法:
<input type="password">
①多行文本框
语法:
<textarea rows="行数" cols="列数">多行文本框内容</textarea>
(三)、select和option
下拉列表由<select>标签和<option>标签配合使用。
语法:
<select multiple="mutiple" size="可见列表项的数目">
<option value="选项值" selected="selected">选项显示的内容</option>
……
<option value="选项值">选项显示的内容</option>
</select>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。