0
`; // Inicialmente, muestra 0 elementos en la wishlist wishlistHeartButton.classList.add('wishlistheart-button'); // Inyectar el botón en el DOM en el punto asignado targetElement.prepend(wishlistHeartButton); // Actualizar el contenido del botón con el número de elementos en la wishlist cuando se actualice window.addEventListener('wishlistUpdated', function(e) { console.log('La wishlist ha sido actualizada. Elementos en wishlist:', e.detail.count); // Actualizar el contenido del botón con el nuevo valor del contador wishlistHeartButton.innerHTML = `❤${e.detail.count}
`; }); })();