I'm attempting to create a dropdown menu similar to the one in Gmail using Bootstrap.
https://i.sstatic.net/K1NCg.png
However, I have encountered 2 issues:
1- I am unable to click on the input checkbox to select all
2 - I would like it so that if I select all, the input gets selected, and if I choose none, the selection is removed from the input
So, if I click on "All", the input should be selected. If I click on "None," the selection should be removed from the input. And if I click on the input box beside the down arrow, all options should be selected. Do you understand?
Apologies if this is confusing, I am simply trying to replicate the Google Gmail button appearance. Is there another way to achieve this? Thank you.
HTML:
<div class="row">
<div class="col-sm-3">
<div class="panel-body">
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<input type="checkbox" name="vehicle1" value="Bike">
<i class="fa fa-caret-down" aria-hidden="true"></i>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="#">All</a></li>
<li><a href="#">None</a></li>
</ul>
</div>
</div>
</div>
</div>
JSFiddle: http://jsfiddle.net/dJDHd/2157/