// function to add items to shopping
let cartbutton = document.getElementsByName('ropebutton');
console.log(cartbutton) // prints node []
const cart = [];
for(var i = 0; i < cartbutton.length; i++) {
let button = cartbutton;
console.log(button); // doesn't print
button.addEventListener('click', (event) => {
console.clear();
console.log(event.target);
console.log(event.target.dataset.test);
cart.push(event.target.dataset.test);
console.log(cart)
});
};

$4,500 buy

$3,500 buy

$1,550 buy
```
Подробнее здесь: https://stackoverflow.com/questions/734 ... ot-working
Мобильная версия