snipplets.dev/snipplets/code/JavaScript/addElements.js
2023-08-05 22:45:06 +03:00

4 lines
137 B
JavaScript

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