Best of Amazon

d426a79e49fafe064aebba77b905c4d4-min.png
5:32

10 Ways You Can Improve on Your Sandwich Making

d426a79e49fafe064aebba77b905c4d4-min.png

10 Ways You Can Improve on Your Sandwich Making

PREV

1/1

NEXT

PREV

3/15

PREV

document.querySelectorAll('.e-n-menu-dropdown-icon').forEach((button) => { button.addEventListener('click', function () { const controlsId = this.getAttribute('aria-controls'); const menu = document.getElementById(controlsId); // Toggle aria-expanded attribute const isExpanded = this.getAttribute('aria-expanded') === 'true'; this.setAttribute('aria-expanded', !isExpanded); // Toggle menu visibility if (menu) { menu.style.display = isExpanded ? 'none' : 'block'; console.log('Menu visibility changed:', menu.style.display); } else { console.log('Menu not found for ID:', controlsId); } }); });