0
I’m wearing the event change in a select field, where the corresponding option is the id of a div, what I would like to do is to display the selected div and hide the rest only if it is visible or hidden, in a dynamic way if a hidden div can be displayed again.
the structure basically is 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>
For some reason when I select any option the whole page is hidden kk
– Thiago
If so:
$('[id!="'+id+'"]').hide();
will hide everything, must be like this:$('div[id!="'+id+'"]').hide();
informing that the element is theDIV
– NoobSaibot
still continues, I think it has become generic, it covers all Divs
– Thiago
See I made a modification, added the attribute
class
.– NoobSaibot
now yes, thank you :)
– Thiago