html基础:了解optgroup元素


optgroup元素在下拉选项时候使用,非常方便,看看下面的代码就知道怎么使用了。

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

 

<title>runcode</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Author" content="Sheneyan" />
</head>
<body>
  <select id="WORK_BUSINESS_TYPE" >   

              <option value="0">所有类型</option>
              <optgroup label="外部业务类型">
                  <option value="0">所有类型</option>
                  <option value="0">所有类型</option>
             </optgroup>
             <optgroup label="内部业务类型">
                <option value="0">所有类型</option>
                <option value="0">所有类型</option>
             </optgroup>
       </select>

</body>
</html>


« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3