I'm using the change event in a select field, in which the corresponding option is the id of a div, what I'd like to do is display the selected div and hide the other dives only if it is visible or hidden, in a dynamic way if a div that was hidden can be displayed again.
The structure is basically this:
<select class="form-control" name="template">
<option value="template1">Template 1</option>
<option value="template2">Template 2</option>
</select>
<div id="template1">tema 1</div>
<div id="template2">tema 2</div>