snipplets.dev/~/JavaScript/addElements.js
2022-04-03 09:04:24 +03:00

4 lines
137 B
JavaScript

let newDiv = document.createElement('div');
newDiv.appendChild(document.createTextNode('some text'));
document.body.appendChild(newDiv);