HTML教程,认识optgroup元素
2016-06-24来源:

select的分类选择,经测试IE和FF都能很好的支持该元素 

代码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>runcode</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta name="Author" content="Sheneyan" />

</head>

<body>

<select>

<optgroup label="a">

<option>a1</option>

<option>a2</option>

<option>a3</option>

</optgroup>

<optgroup label="b">

<option>b1</option>

<option>b2</option>

<option>b3</option>

</optgroup>

</select>

</body>

</html>

推荐信息
Baidu
map