Answers for "createElement innerText appendChild"

0

createElement innerText appendChild

var para = document.createElement("P");                       // Create a <p> node
var t = document.createTextNode("This is a paragraph.");      // Create a text node
para.appendChild(t);                                          // Append the text to <p>

 document.getElementById("myDIV").appendChild(para);           // Append <p> to <div> with id="myDIV"
Posted by: Guest on August-31-2021
0

createElement innerText appendChild

var para = document.createElement("P");                       // Create a <p> node
var t = document.createTextNode("This is a paragraph.");      // Create a text node
para.appendChild(t);                                          // Append the text to <p>

 document.getElementById("myDIV").appendChild(para);           // Append <p> to <div> with id="myDIV"
Posted by: Guest on August-31-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language