Answers for "js create paragraph"

12

js create element

var newDiv = document.createElement("div");
document.body.appendChild(newDiv);
Posted by: Guest on April-04-2020
0

create paragraphs with js in html

var p = document.createElement('p');
p.innerHTML = 'some text here';

document.getElementById('some-parent').appendChild(p);
Posted by: Guest on July-19-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language