Код: Выделить всё
var div_1 = document.getElementById("div-1");
var div_2 = document.getElementById("div-2");
div_1.addEventListener('click', function() {
// clicking div_1 and div_2 does the same thing
});
div_2.addEventListener('click', function() {
// clicking div_1 and div_2 does the same thing
});
Подробнее здесь: https://stackoverflow.com/questions/794 ... ing-into-1
Мобильная версия