user2592358 user2592358 - 12 days ago 16
HTML Question

Uncaught TypeError: $(…).multiselect is not a function

I'm trying to use the multi select plugin (http://davidstutz.github.io/bootstrap-multiselect/)

I get the folllowing error: $(...).multiselect is not a function

and I can't figure out how to make it work...

<!-- Include Twitter Bootstrap and jQuery: -->
<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css"/>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>

<!-- Include the plugin's CSS and JS: -->
<script type="text/javascript" src="js/bootstrap-multiselect.js"></script>
<link rel="stylesheet" href="css/bootstrap-multiselect.css" type="text/css"/>


Here is my select:

<select class="multiselect" multiple="multiple">
<option value="0">value0</option>
<option value="1">value1</option>
<option value="2">value2</option>
<option value="3">value3</option>
</select>


And then I call the plugin:

<script type="text/javascript">
$(document).ready(function(){
$('.multiselect').multiselect();
});
</script>


I've tried to call the plugin where I link the css and js, but it still won't work.

Answer

I found my mistake!

I was linking another jquery.min.js further in my code. Now it works just fine!

Comments