1
Greetings. I created some div inside a foreach, all with the same class, inside that div has an element that I wish, when clicked, show another div that is inside the parent div created. However, as expected, when I trigger such an event, all sub-Ivs of all created Ivs are shown.
To illustrate, it follows a code that replicates what I’m doing:
HTML:
<div class='pai'>
<i class='elementoDisparo'>
<div class="divQueAparece">
</div>
<div class='pai'>
<i icon dropdown class='elementoDisparo'>
<div class="divQueAparece">
</div>
<div class='pai'>
<i icon dropdown class='elementoDisparo'>
<div class="divQueAparece">
</div>
Javascript
window.addEventListener('load', function(){
$(".divQueAparece").hide();
$(".elementoDisparo").click(function(){
$(".divQueAparece").toggle(300);
});
});
WOW!!! Very good!!!
– Anderson Amorim