Hi, I have my page code
<select class="form-control" id="selected">
<option selected="selected" value="0">Selecione</option>
<option value="a">MONTAGEM LATERAL</option>
<option value="b">MONTAGEM TETO</option>
<option value="c">MONTAGEM SEMI-EMBUTIDA</option>
<option value="d">MONTAGEM SOBRE A BASE</option>
</select>
<div id="colors">
<div id="a">
<p>a</p>
</div>
<div id="b">
<p>b</p>
</div>
<div id="c">
<p>c</p>
</div>
<div id="d">
<p>d</p>
</div>
in a separate javascript file I have the following code
$(function(){
$("#selected").change(function(){
$('#colors div').hide();
$('#'+$(this).val()).show();
});
});
What is happening that, is appearing all the div and only when I choose one that hides the other div and appears the correct one, but the correct one would be when loading the page hide all the div and only appear when they are selected. Apparently something is wrong with my javascript code