Answer the question
In order to leave comments, you need to log in
How can you run a function when any of the listed events occur?
Hello, how can I start the launch of the function when any of the listed events occurs?
1 event:
$('.json').on('click', function () {
//убираем активность со всех кнопок класса и вешаем на активированную
$('.json').removeClass('active');
$(this).addClass('active'); });
$('button').on(click) ||
$('#select').on("select:close") ||
$('.json').on('click', function () {
//убираем активность со всех кнопок класса и вешаем на активированную
$('.json').removeClass('active');
$(this).addClass('active'); });
Answer the question
In order to leave comments, you need to log in
$('button, #select').on('click select:close', function(){})
or assign each selector its own on() function (approximately as in your examples);
or write 1nu function, and pull it through onclick="" in the right tags.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question