IS
Size: a a a
IS
Рк
IS
IS
И
IS
const products = document.querySelector('.products');
products.addEventListener('click', (event) => {
const element = event.target;
if (element.classList.contains('add_to_cart_button')) {
event.preventDefault();
new MutationObserver((mutations, observer) => {
mutations.forEach(({ attributeName, target }) => {
if (attributeName === 'class' && target.classList.contains('added')) {
target.textContent = target.textContent === 'В корзине' ? 'В корзину' : 'В корзине';
ovserver.disconnect();
}
})
}).observe(element, { attributes: true });
}
});
IS
IS
IS
IS
И
И
И
OJ
И
IS
И
mm