Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript append to paragraph

// In the JS script

var parElement = document.getElementById("myPar");
var textToAdd = document.createTextNode("Text to be added");
parElement.appendChild(textToAdd);

//In the HTML file

<p id="myPar"></p>
 
PREVIOUS NEXT
Tagged: #javascript #append #paragraph
ADD COMMENT
Topic
Name
4+4 =