Is it possible to create a multi-select checkbox dropdown like this in Bootstrap, HTML and JavaScript.
I have tried I couldn't able to achieve it. I'm new to JavaScript as well However I'm just exploring the JS and make it to work but this seems really challenging for me. I don't know how to implement JS script for this.
For instance: If the user selects the countries in the multiselect checkbox I want it to show it all countries name instead of Choose option.
code:
<div>Country</div>
<div class="row" name="country_checkbox" id="id_row">
<div class="dropdown">
<a aria-expanded="false" aria-haspopup="true" role="button" data-toggle="dropdown" class="dropdown-toggle" href="#">
<span id="selected">Choose option</span><span class="caret"></span></a>
<ul id="id_country">
<li><label for="id_country_0"><input type="checkbox" name="country" value="US"
placeholder="Select Country" id="id_country_0" onclick="filter_type();">
US</label>
</li>
<li><label for="id_country_1"><input type="checkbox" name="country" value="India"
placeholder="Select Country" id="id_country_1" onclick="filter_type();">
India</label>
</li>
<li><label for="id_country_2"><input type="checkbox" name="country" value="Japan"
placeholder="Select Country" id="id_country_2" onclick="filter_type();">
Japan</label>
</li>
<li><label for="id_country_3"><input type="checkbox" name="country" value="UK"
placeholder="Select Country" id="id_country_3" onclick="filter_type();">
UK</label>
</li>
</ul>
</div>
js fiddle here: http://jsfiddle.net/shalman44/92drs7ax/3/