0
点赞
收藏
分享

微信扫一扫

利用optgroup进行下拉框分组

optgroup 可以对option进行分组,在一些特殊场景可以用做提示使用

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
    </head>
    <body>
        select选项分组
        <select>
            <optgroup label="城市">
                <option>武汉</option>
                <option>上海</option>
            </optgroup>
            <optgroup label="省份">
                <option>湖北</option>
                <option>湖南</option>
            </optgroup>
        </select>
    </body>
</html>
举报

相关推荐

0 条评论