I want to show and hide a div, it is a list that has a class are 4 div, with the same class and the button that should show also has the same class, the problem I have is that with the function that I have it shows me all the div or just the one that I indicate the index what I need is that it shows the element that was clicked, I hope it is understood.
This is my code:
$('.info-team').hide();
$(".leer-mas").on("click", function() {
$('.info-team').each(function(indice) {
if (indice == 1) {
$(this).css('display', 'block');
}
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div>
<div class="name-team">team 1
<span class="leer-mas">Leer más</span>
</div>
<div class="info-team" style="display: none;">GMR holders benefit by having the right to bet other competitors in P2P, witness and vote in real time on events, host private betting competitions and claim rewards from referrals. </div>
</div>
<div>
<div class="name-team">team 2
<span class="leer-mas">Leer más</span>
</div>
<div class="info-team" style="display: none;">GMR holders benefit by having the right to bet other competitors in P2P, witness and vote in real time on events, host private betting competitions and claim rewards from referrals. </div>
</div>
<div>
<div class="name-team">team 3
<span class="leer-mas">Leer más</span>
</div>
<div class="info-team" style="display: none;">GMR holders benefit by having the right to bet other competitors in P2P, witness and vote in real time on events, host private betting competitions and claim rewards from referrals. </div>
</div>
<div>
<div class="name-team">team 4
<span class="leer-mas">Leer más</span>
</div>
<div class="info-team" style="display: none;">GMR holders benefit by having the right to bet other competitors in P2P, witness and vote in real time on events, host private betting competitions and claim rewards from referrals. </div>
</div>