Skip to content

Instantly share code, notes, and snippets.

@danomanion
Created March 7, 2019 15:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danomanion/da644f4e4462aad91f0ffe5487e52d38 to your computer and use it in GitHub Desktop.
Save danomanion/da644f4e4462aad91f0ffe5487e52d38 to your computer and use it in GitHub Desktop.
List - JS / HTML
<div id="container">
</div>
const items = [
'thingie',
'another item',
'some thingie',
'yadda yadda'
];
function listOfStuff() {
let full_list = '';
for (let i = 0; i < items.length; i++) {
full_list = full_list + `<li> ${items[i]} </li>`
}
const contain = document.querySelector('#container');
contain.innerHTML = `<ul> ${full_list} </ul>`;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment