I
I
Ilya Famin2021-06-08 17:58:11
JavaScript
Ilya Famin, 2021-06-08 17:58:11

How to "spawn" a block next to another block?

That is, you need not just add some class to one of the many blocks (as done below), but “spawn” it next to the block in which the
PS button was pressed. only one block appears and only in the element inside which there was a click

$('.post').on('click', 
    function () {
        $('.OPa').removeClass('OPa')
        $(this).find('.post-info').toggleClass('OPa');
    }
)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex, 2021-06-08
@Kozack

https://developer.mozilla.org/en/docs/Web/API/Elem...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question