Difference between revisions of "DOM content from lists"

From ProgZoo
Jump to navigation Jump to search
(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 ['...")
 
Line 1: Line 1:
<pre id='shellbody' data-qtp='fetch'></pre>
<pre id='shellbody' data-qtp='fetch'></pre>
<div class=qu>
== Show a list of numbers ==
== Show a list of numbers ==
*When you have data in a list you can use map to generate content
*When you have data in a list you can use map to generate content

Revision as of 07:33, 26 August 2021


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);
}