[英]how to make dropdown list with one selected item in drop down in html
i have two items in dropdown when any one i selects, then only the particular item data comes.i want one data by default come. 当我选择任何一项时,我在下拉列表中有两个项目,那么只有特定的项目数据才会出现。我希望默认情况下有一个数据出现。
html html
<div class="box-header">
<div class="dropdown" align="left">
<button class="" type="button" data-toggle="dropdown" style="height:22px;" align="center">
<span style="font-size:18px;font-family:sans-serif">Select Water Tank </span>
<span class="caret"></span>
</button>
<ul class="dropdown-menu" >
<li><a href="@Url.Action("list", "Watertank" ,new { deviceid="f2"})"><span style="font-size:large">Top</span></a></li>
<li><a href="@Url.Action("list", "Watertank" ,new { deviceid="52"})"><span style="font-size:large">Bottom</span></a></li>
</ul>
</div>
</div>
You can do it by changing the drowdown from <ul>
to <select>
您可以通过将下拉菜单从
<ul>
更改为<select>
The code below should have the 'top' one selected by default 默认情况下,以下代码应选择“顶部”
<div class="box-header">
<div class="dropdown" align="left">
<button class="" type="button" data-toggle="dropdown" style="height:22px;" align="center">
<span style="font-size:18px;font-family:sans-serif">Select Water Tank </span>
<span class="caret"></span>
</button>
<select class="bootstrap-select" >
<option selected="selected"><a href="@Url.Action("list", "Watertank" ,new { deviceid="f2"})"><span style="font-size:large">Top</span></a></option>
<option><a href="@Url.Action("list", "Watertank" ,new { deviceid="52"})"><span style="font-size:large">Bottom</span></a></option>
</select>
</div>
</div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.