I'm using the code below to select options from drop down, but I'm getting:
Uncaught TypeError: $(...).selectBox is not a function.
in console. I'm going to use jquery-selectBox.
My code:
<script>
$(document).ready(function() {
$("SELECT").selectBox();
$("SELECT").selectBox('settings', {
'menuTransition': 'fade',
'menuSpeed': 'fast'
});
});
</script>
and in the body tag I get a select field:
<select class="selectBox">
<option value="0">Login Type</option>
<option value="1">Admin</option>
<option value="2">Customer</option>
</select>
I included all JavaScript sources in my code, but still it's giving me the error. Any solution?
In order to use jQuery selectBox, just load it properly on your page (e.g. via CDN).
Note
To use your markup more efficiently, in this case, use your element's
classattribute and its valueselectBoxto select it using jQuery, e.g.:Your markup:
Select it via: