bootstrap select not showing items
Below HTML is working fine, SECTION end/closing is missing in your html, Kindly remove script of document.ready as well. Refer below html.
<!DOCTYPE html><html><head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <!-- Latest compiled and minified CSS --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.4/css/bootstrap-select.min.css"><!-- Latest compiled and minified JavaScript --><script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.4/js/bootstrap-select.min.js"></script></head><body> <section id="about-us" class="container main"> <div class="row-fluid"> <div class="span8" > <div class="blog"> <div class="blog-item well"> <a href="#"><h2>Heading2</h2></a> <select class="selectpicker" id="select_county" data-live-search="true" data-style="btn-primary"> <option>County1</option> <option>County2</option> </select> <select class="selectpicker" id="select_event" data-live-search="true" data-style="btn-primary"> <option>event1</option> <option>event2</option> </select> <input type="submit" class="btn btn-info" value="Submit Button"> </div> </div> </div></div> </section></body></html>
Move the Js files and the <script>
, at the end before close body
tag:
<body> <script src="{{ url_for('static', filename='js/jquery-3.2.1.min.js')}}" ></script> <script src="{{ url_for('static', filename='js/bootstrap.min.js')}}"></script> <script src="{{ url_for('static', filename='js/bootstrap-dropdown.js')}}" ></script> <script src="{{ url_for('static', filename='js/bootstrap-select.js')}}" ></script> $(document).ready(function() { $('.selectpicker').selectpicker({ style: 'btn-default', size: false });});</body>