function createMenu(response) {
			const days = document.getElementById('dayOptions').value;
			selectRandomMeals(response, days, createListHTML);

			const removeBtnArr = document.querySelectorAll('.js-btn--remove');
			const	clearBtn = document.querySelector('js-btn--clear');

			// linkItemArr.forEach(function(item) {
			// 	let link = item.closest('a')
			// 	link.addEventListener('click', showDetails);
			// });

			// Add event listeners to X btns
			removeBtnArr.forEach(item => {
				const button = item.closest('button');
				button.addEventListener('click', removeListItem);
			});
		}
// Build and inject menu based on fetch() response
Build and inject menu based on fetch() response
Build and inject menu based on fetch () response
function createMenu(response) {
			const days = document.getElementById('dayOptions').value;
			selectRandomMeals(response, days, createListHTML);
			const removeBtnArr = document.querySelectorAll('.js-btn--remove');
			const	clearBtn = document.querySelector('js-btn--clear');
			removeBtnArr.forEach(item => {
				const button = item.closest('button');
				button.addEventListener('click', removeListItem);
			});
		}
function createMenu ( response ) { const days = document . getElementById ( 'dayOptions' ) . value ; selectRandomMeals ( response , days , createListHTML ) ; const removeBtnArr = document . querySelectorAll ( '.js-btn--remove' ) ; const clearBtn = document . querySelector ( 'js-btn--clear' ) ; removeBtnArr . forEach ( item => { const button = item . closest ( 'button' ) ; button . addEventListener ( 'click' , removeListItem ) ; } ) ; }
Build and inject menu based on fetch() response
Build and inject menu based on fetch () response
// linkItemArr.forEach(function(item) { // 	let link = item.closest('a') // 	link.addEventListener('click', showDetails); // }); // Add event listeners to X btns