Input with datalist grouping

I do with select in two ways:

  • With disabled option.
  • With optgroup tag.
  • <select name="curso1" id="curso1">
        <option disabled="" style="font-size:12px; text-align:left; font-family:Arial Black">Group</option>
        <option value="1">Windows 8</option>
        <option value="8">lalalala</option>
    </select>
    <select>
        <optgroup label="Swedish Cars">
            <option value="volvo">Volvo</option>
            <option value="saab">Saab</option>
        </optgroup>
        <optgroup label="German Cars">
            <option value="mercedes">Mercedes</option>
            <option value="audi">Audi</option>
        </optgroup>
    </select>

    This looks neat on Chrome, but I don't know how it will render in other browsers.

    在这里输入图像描述

    <label>Choose a browser from this list:
    <input list="browsers" name="myBrowser" /></label>
    <datalist id="browsers">
      <option value="Brave">GroupA</option>
      <option value="Firefox"></option>
      <option value="Safari"></option>
      <option value="Opera">GroupB</option>
      <option value="Internet Explorer"></option>
      <option value="Microsoft Edge"></option>
    </datalist>
    链接地址: http://www.djcxy.com/p/29930.html

    上一篇: Xcode 7.1:带有retain或strong属性的属性必须是对象类型

    下一篇: 使用数据分组输入