jQuery Hide Show when multiple selectors

advertisements

I am trying to toggle hide/show on multiple elements, and it works on mobile, however on desktop, my code seems to hide/show all of them instead of the parent that is being clicked on.

var t = $(this).find*
$('div a i').click(function(){
    $('.text').toggleClass('show');
});

Here is a CodePen with my markup.

Any help is appreciated!


did you try this?

Edit to your comment:

$('div.pop-up').click(function(){
    $('.text').removeClass('show');
    $(this).find('.text').toggleClass('show');
});

You have to say which div to click by class, otherwise, partent div's are clicked as will...