1. 程式人生 > >layui下拉框總結

layui下拉框總結

<optgroup label="學生時代">

<option value="你的工號" selected >你的工號</option>

<option value="你最喜歡的老師">你最喜歡的老師</option>

</optgroup>

<div class="layui-inline">

     <label class="layui-form-label">搜尋選擇框</label>

     <div class="layui-input-inline">

     <select name="modules" lay-verify="required" lay-search="">

             <option value="">直接選擇或搜尋選擇</option>

             <option value="1">layer</option>

             <option value="2">form</option>

             <option value="3">layim</option>

             <option value="4">element</option>

             <option value="5">laytpl</option>

        <option value="6">upload</option>

</select>

</div>

Layui聯動下拉框排版樣式

<div class="layui-form-item">

            <label class="layui-form-label">聯動選擇框</label>

            <div class="layui-input-inline">

                <select name="quiz1">

                    <option value="">請選擇省</option>

                    <option value="浙江" selected="">浙江省</option>

                    <option value="江西省">江西省</option>           

            </div>

            <div class="layui-input-inline">

                <select name="quiz2">

                    <option value="">請選擇市</option>

                    <option value="杭州">杭州</option>

                    <option value="寧波" disabled="">寧波</option>

                </select>

            </div>

<div class="layui-form-mid layui-word-aux">此處只是演示聯動排版,並未做聯動互動</div>

</div>

下拉框各選項樣式:selected,disabled。

 

https://www.layui.com/demo/form.html