DOM content from lists

From ProgZoo
Revision as of 07:33, 26 August 2021 by Andr3w (talk | contribs) (Created page with "<pre id='shellbody' data-qtp='fetch'></pre> == Show a list of numbers == *When you have data in a list you can use map to generate content <pre class=usr> for(let beatle of ['...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Show a list of numbers

  • When you have data in a list you can use map to generate content
for(let beatle of ['John", 'Paul', 'George', 'Ringo']){
  let div = document.createElementById('div');
  div.innerHTML = beatle;
  document.body.append(div);
}
for(let beatle of ['John", 'Paul', 'George', 'Ringo']){
  let div = document.createElementById('div');
  div.innerHTML = beatle;
  document.body.append(div);
}