Default text which won't be shown in drop-down list

后端 未结 8 1454
情话喂你
情话喂你 2020-11-28 02:17

I have a select which initially shows Select language until the user selects a language. When the user opens the select, I don\'t want it to show a

相关标签:
8条回答
  • 2020-11-28 02:59

    Here is the solution:

    <select>
        <option style="display:none;" selected>Select language</option>
        <option>Option 1</option>
        <option>Option 2</option>
    </select>
    
    0 讨论(0)
  • 2020-11-28 03:05

    Try this:

    <div class="selectSelection">
        <select>
            <option>Do not display</option>
            <option>1</option>
            <option>1</option>
        </select>
    </div>
    

    In the CSS:

    .selectSelection option:first-child{
        display:none;
    }
    
    0 讨论(0)
提交回复
热议问题