Jess McKenzie Jess McKenzie - 1 year ago 79
HTML Question

Bootstrap 3 dropdown select value

I am trying to create a dropdown menu using

with a
. How can I do this using Bootstrap?

<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" id="type" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
Please Select
<span class="caret"></span>
<ul class="dropdown-menu" aria-labelledby="type">
<li><a href="#">General User</a></li>
<li><a href="#">Service Provider</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Admin</a></li>

Answer Source

For form components such as select bootstrap use .form-control, see docs here and see select docs example here

<link href="" rel="stylesheet" />
<select class="form-control">
  <option value="General User">General User</option>
  <option value="Service Provider">Service Provider</option>
  <option value="Admin">Admin</option>