Simple bootstrap-select not working

问题: <!DOCTYPE html> <html> <head> <title></title> <link rel="stylesheet" type="text/css" href="bootstrap-select.min.css"> </head&...


<!DOCTYPE html>
    <link rel="stylesheet" type="text/css" href="bootstrap-select.min.css">
    <select class="selectpicker">

    <script type="text/javascript" src="jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="bootstrap-select.min.js"></script>
    <script type="text/javascript">

I have this code. I'm using jquery 3.3.1 I used bootstrap-select from and copy it to my local to save some load time. But when I tried to run this, I got this result:

Bootstrap-select .selectpicker not working

Did I do thing wrong? I've tried searching for answer, but can't seem to found any working answer. Thanks.

NB: I tried using Chrome and Firefox, both gave me the same result.


The dependencies section of this link has your answer.

For this to work, you needs :

  • jQuery v1.8.0+
  • Bootstrap’s dropdown.js
  • Bootstrap's CSS

If you don't have bootstrap in your project, you can add the minified version and customize it for your needs and recompile it.

PS Don't use the bootstrap version 4 because it will probably not work.

Hope it helps !


Looks like you need to include Bootstrap’s dropdown.js component, and Bootstrap's CSS. Only then you can use bootstrap-select. Info is here at the very top

Take a look at this fiddle


try this hope it helps :)

$(document).ready(function(e) {
<link href="" rel="stylesheet">
<link rel="stylesheet" type="text/css" media="screen" href="">

<select class="selectpicker" data-live-search="true">
  <option data-tokens="ketchup mustard">Hot Dog, Fries and a Soda</option>
  <option data-tokens="mustard">Burger, Shake and a Smile</option>
  <option data-tokens="frosting">Sugar, Spice and all things nice</option>

<script src=""></script>
<script src=""></script>
<script src=""></script>

  • 发表于 2018-07-05 12:06
  • 阅读 ( 306 )
  • 分类:sof


请先 登录 后评论


作家榜 »

  1. 小编 文章