当前位置:网站首页>Select tag - uses the default text as a placeholder prompt but is not considered a valid value

Select tag - uses the default text as a placeholder prompt but is not considered a valid value

2022-06-26 13:36:00 woowen!

select label - Use the default text as a placeholder prompt but not as a valid value

Graphic effect :

The code snippet is as follows : 

<select>
        <option value="" selected disabled hidden> Please select a city you have been to </option>
        <option value="1"> Beijing </option>
        <option value="2"> Shanghai </option>
        <option value="3"> Guangzhou </option>
        <option value="4"> Chengdu </option>
      </select>

Here's the point :

stay option Add on label selected disabled hidden attribute

原网站

版权声明
本文为[woowen!]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202170514022176.html