It may be missing some file. Add how you referenced them in your html
.
Remembering that you need to "start" the material_select()
, in this way:
$(document).ready(function() {
$('select').material_select();
});
A functional example of select
is below:
<script type="text/javascript" src="//code.jquery.com/jquery-2.1.4.js"></script><style type="text/css"></style>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.5/css/materialize.min.css">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.5/js/materialize.min.js"></script>
<script type="text/javascript">//<![CDATA[
window.onload=function(){
$(document).ready(function() {
$('select').material_select();
});
}//]]>
</script>
<div class="input-field col s12">
<select multiple>
<option value="" disabled selected>Choose your option</option>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
</select>
<label>Materialize Multiple Select</label>
</div>
The same can be seen in Jsfiddle.
Related: Materialize CSS - Select Doesn’t Seem to Render
You initialized the plugin using the:
$('select').not('.disabled').material_select();
?– Diego Souza
Yeah, it didn’t work either =/
– Ingi
Did you reference the jQuery.js file before the materialize.js file? You put them at the bottom of the page before the
</body>
?– Guilherme Lopes
yes I put before the /body
– Ingi