给select增加placeholder技巧

思路1:

使用默认的option 再隐藏此选项

<select>
    <option value='' disabled selected style='display:none;'>Please Choose</option>
    <option value='0'>Open when powered (most valves do this)</option>
    <option value='1'>Closed when powered, auto-opens when power is cut</option>
</select>

 

思路2:

使用默认option再disabled此选项

<select>
    <option value="" disabled selected>Select your option</option>
    <option value="hurr">Durr</option>
</select>

posted @ 2018-11-28 13:18  诸葛小朙  阅读(4182)  评论(0编辑  收藏  举报