Browse Source

copy static element

pull/2/head
maaan 1 year ago
parent
commit
79baa5458b
  1. 8
      script.js

8
script.js

@ -2,4 +2,10 @@ const appEl = document.querySelector('#app'); @@ -2,4 +2,10 @@ const appEl = document.querySelector('#app');
const div = document.createElement('div');
const text = document.createTextNode('asdfasdfdsf');
div.append(text);
appEl.append(div);
appEl.append(div);
const staticEl = document.querySelector('#static');
const staticCopy = staticEl.cloneNode(true);
staticEl.append(div);
console.log('staticEl', staticEl);
console.log('staticCopy', staticCopy);
Loading…
Cancel
Save