Greetings. I created some div inside a foreach, all with the same class, inside this div has an element that I want, when clicked, show another div that is inside the created parent div. However, as expected, when I trigger such an event, all sub-divs of all created divs are displayed.
For example, here's 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);
});
});