JSFiddle - React, Tailwind, and code Playground

by fxi

HTML

<div id="dash">
  <widget id="graph">a</widget>
  <widget id="graph">n</widget>
</div>

<div id="out"></div>

<pre id="res"></pre>

CSS

#dash {
  outline: 1px solid green;
}

#out {
  outline: 1px solid red;
}

JavaScript

const a = graph;
const b = document.getElementById('graph');

for (const x of a) {
  out.appendChild(x);
  res.innerText += "add a in out \n"
}
out.appendChild(b);
res.innerText += "add b in out \n";