<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>下拉菜单</title>
</head>
<body>
<form >
<table rules="none" align="center">
<tr>
<td width="100px" height="200px">
<select name="fruit" >
<option value ="西瓜">西瓜</option>
<option value ="榴莲" selected="">榴莲</option> <!-- selected默认选中 -->
<option value ="橙子">橙子</option>
<option value ="荔枝">荔枝</option>
<option value ="菠萝">菠萝</option>
<option value ="龙眼">龙眼</option>
<option value ="草莓">草莓</option>
<option value ="雪梨">雪梨</option>
<option value ="苹果">菠萝</option>
</select>
</td>
<td width="100px" height="200px">
<select name="fruit" size="6" multiple=""> <!-- size:可见数量 multiple可多选(按住Ctrl) -->
<option value ="西瓜">西瓜</option>
<option value ="榴莲">榴莲</option>
<option value ="橙子">橙子</option>
<option value ="荔枝">荔枝</option>
<option value ="菠萝">菠萝</option>
<option value ="龙眼">龙眼</option>
<option value ="草莓">草莓</option>
<option value ="雪梨">雪梨</option>
</select>
<td height="200px">
<select name="城市" > <!-- 分组菜单列表 -->
<option value ="默认">--请选择--</option>
<optgroup label="北方">
<option value ="北京">北京</option>
<option value ="黑龙江">山西</option>
<option value ="江西">江西</option>
</optgroup>
<optgroup label="南方">
<option value ="广州">广州</option>
<option value ="深圳">深圳</option>
<option value ="珠海">珠海</option>
</optgroup>
</select>
</td>
</td>
</tr>
<tr>
<td >
<textarea name="test" rows="5" placeholder="ssss" >
多行文本域多行文本域多行文本域多行文本域多行文本域多行文本域多行文本域
</textarea>
</td>
</tr>
<tr>
<td>
<input type="submit" name="" id="" value="提交" />
</td>
</tr>
</table>
</form>
</body>
</html>
前端笔记HTML表单(2)----下拉菜单和多行文本域
最新推荐文章于 2022-05-18 23:23:27 发布