Answers for "how to add text to a paragraph in html with javascript"

C#
3

how add text to element in javascript

var paragraph = document.getElementById("p");

paragraph.textContent += "This just got added";
Posted by: Guest on May-19-2021
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 "how to add text to a paragraph in html with javascript"

C# Answers by Framework

Browse Popular Code Answers by Language