Answer the question
In order to leave comments, you need to log in
How to correctly pass changes on click to another class?
There are 2 different classes, how to connect them correctly, in one, onclick should occur, and in the other, the reaction to these changes.
Without using jQ
Answer the question
In order to leave comments, you need to log in
Through events. For example in jQuery:
// класс1
$some.on('click', function () {
$(document).trigger('custom_event', data);
});
// в классе 2 подписываемся на это событие
$(document).on('custom_event', function (data) {
// выполняем наш код, после события в классе 1
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question