简体   繁体   English

默认选项不在 select 标签中

[英]the default option is not coming in select tag

enter image description here I want to add the default option select in select tag but it taking the default value from the api data enter image description here我想在 select 标签中添加默认选项 select 但它从 api 数据中获取默认值

Here the select should come rather than taking default value from api这里 select 应该出现而不是从 api 中获取默认值

By selected props you can make it default selected: (Note: I am pasting example please change as per your requirement.)通过选择道具,您可以将其设为默认选择:(注意:我是粘贴示例,请根据您的要求进行更改。)

<select name="plan" id="plan">
    <option value="free">Free</option>
    <option value="starter" selected>Starter </option>
    <option value="professional">Professional</option>
    <option value="corporate">Corporate</option>
</select>

So Here starter (second one) will be default selected.所以 Here starter(第二个)将被默认选中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM