Advertisement
Guest User

index.js

a guest
Apr 4th, 2020
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var listElement = document.querySelector('#app ul');
  2. var inputElement = document.querySelector('#app input');
  3. var buttonElement = document.querySelector('#app button');
  4.  
  5. todos = [
  6.     'asdasd',
  7.     'dasdaaa',
  8.     'daaaaaa'
  9. ];
  10.  
  11. function renderTodos() {
  12.     for (todo of todos) {
  13.         var todoElement = document.createElement('li');
  14.         var todoText = document.createTextNode(todo);
  15.  
  16.         todoElement.appendChild(todoText);
  17.         listElement.appendChild(todoElement);
  18.     }
  19. }
  20. renderTodos();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement