It turns out that I have a divs filtering code, which shows me one or another element, the filtering I do with jQuery, the problem is that I want to start loading the page, do not show me all the options, if not, do not show me any and when selecting one of the options show by correct filtering
The code is the following:
$(document).ready()
$('#tipoImpresora').change(function () {
var year = $(this).val();
$("div").hide();
$("div:contains('" + year + "')").show();
});
div {
background: #eee;
height: 300px;
width: 280px;
text-align: center;
display: inline-block;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<form>
<select id="tipoImpresora">
<option value="0">ninguno</option>
<option value="Impresora Laser" selected="true">laser</option>
<option value="Impresora Tinta">tinta</option>
</select>
</form>
<div class="Laser" style="background-color: red;">
<p>Impresora Laser</p>
<img src="#">
<img src="#">
<br>
<table>
<tr>
<td>Marca</td>
<td><input type="text" name="txtMarca"></td>
</tr>
<tr>
<td>Modelo</td>
<td><input type="text" name="txtMarca"></td>
</tr>
<tr>
<td>Color Tinta</td>
<td><input type="text" name="txtMarca"></td>
</tr>
</table>
<br>
<button>Seleccionar</button>
</div>
<div class="Tinta" style="background-color: blue;">
<p>Impresora Tinta</p>
<img src="#">
<img src="#">
<br>
<table>
<tr>
<td>Marca</td>
<td><input type="text" name="txtMarca"></td>
</tr>
<tr>
<td>Modelo</td>
<td><input type="text" name="txtMarca"></td>
</tr>
<tr>
<td>Color Tinta</td>
<td><input type="text" name="txtMarca"></td>
</tr>
</table>
<br>
<button>Seleccionar</button>
</div>
It turns out that when loading the page it shows me the red block and the blue block, and I do not want to show any of them except that I make my first choice in the select.