I have a little problem with some things that I'm doing in js and that are not working well for me.
The subject is like this: I have a select where the user chooses options:
<select id="cobertura" name="cobertura">
<option value="">Elija una opción...</option>
<option value="1">Opción 1</option>
<option value="2">Opción 2</option>
<option value="3">Opción 3</option>
</select>
According to what the user selects, he will show me or not certain "divs" on the page for what I do:
<div id="div_1" class="contenido">
<!-- muestro contenido -->
</div>
<div id="div_2" class="contenido">
<!-- muestro otro contenido diferente -->
</div>
Now, when the user chooses option 3, what I have to show are the two divs for this I do:
<script type="text/javascript">
$(document).ready(function(){
$(".contenido").hide();
$("#cobertura").change(function(){
$(".contenido").hide();
$("#div_" + $(this).val()).show();
});
});
</script>
Now, this validation before the event of the select goes well, that is, it shows me only div1 in option 1 and only div2 in option 2 but I do not know how to build that shows me the two divs with the option 3
Can someone guide me?