function createListHTML(arr) {
		const container = document.createElement('section');
		const main = document.querySelector('main');
		const list = document.createElement('ul');
		const btnWrapper = document.createElement('div');
		const clearBtn = document.createElement('button');

		container.className = 'content-container --no-border js-list-container';
		list.className = 'list js-list';
		btnWrapper.className = 'btn-wrapper';
		clearBtn.className = 'secondary-btn --link js-btn--clear';
		clearBtn.innerHTML = 'Clear list';

		main.appendChild(container);
		container.appendChild(list);
		container.appendChild(btnWrapper);
		btnWrapper.appendChild(clearBtn);
		clearBtn.addEventListener('click', removeList);

		populateList(arr);
	}
// Create HTML elements and inject into DOM
Create HTML elements and inject into DOM
Create HTML elements and inject into DOM
function createListHTML(arr) {
		const container = document.createElement('section');
		const main = document.querySelector('main');
		const list = document.createElement('ul');
		const btnWrapper = document.createElement('div');
		const clearBtn = document.createElement('button');
		container.className = 'content-container --no-border js-list-container';
		list.className = 'list js-list';
		btnWrapper.className = 'btn-wrapper';
		clearBtn.className = 'secondary-btn --link js-btn--clear';
		clearBtn.innerHTML = 'Clear list';
		main.appendChild(container);
		container.appendChild(list);
		container.appendChild(btnWrapper);
		btnWrapper.appendChild(clearBtn);
		clearBtn.addEventListener('click', removeList);
		populateList(arr);
	}
function createListHTML ( arr ) { const container = document . createElement ( 'section' ) ; const main = document . querySelector ( 'main' ) ; const list = document . createElement ( 'ul' ) ; const btnWrapper = document . createElement ( 'div' ) ; const clearBtn = document . createElement ( 'button' ) ; container . className = 'content-container --no-border js-list-container' ; list . className = 'list js-list' ; btnWrapper . className = 'btn-wrapper' ; clearBtn . className = 'secondary-btn --link js-btn--clear' ; clearBtn . innerHTML = 'Clear list' ; main . appendChild ( container ) ; container . appendChild ( list ) ; container . appendChild ( btnWrapper ) ; btnWrapper . appendChild ( clearBtn ) ; clearBtn . addEventListener ( 'click' , removeList ) ; populateList ( arr ) ; }
Create HTML elements and inject into DOM
Create HTML elements and inject into DOM