A Pen by Dano Manion on CodePen.
Created
March 7, 2019 15:33
-
-
Save danomanion/da644f4e4462aad91f0ffe5487e52d38 to your computer and use it in GitHub Desktop.
List - JS / HTML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="container"> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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