jquery – Hide\show div


I have the Nth number of such elements on the page:

<div class="main">
<a class="text">Любой текст</a>
<div class="buttons">кнопки</div> //этот элемент скрыт по-умолчанию.

I need that when I click on

<a class="text">Любой текст</a>

Showing div buttons . And only the one that is in this main block.

I found an example script and adjusted it a bit, but the problem is that this opens the buttons of all elements. How to change it?

Link to JSFiddle


Another option that definitely works in chrome:

$(".text").click(function() {


$(".text").click(function() {
e = $(this).closest('.main').find('.buttons');
    if(!e.is(':visible')) {

Understood so.

Scroll to Top