Answers for "javascript make html"

12

js create element

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

generate html with javascript

let elem = document.getElementById("the tag you want to change code of");
elem.innerHTML = "<p>Hello</p>";
document.innerHTML += '<a href=\"youtue.com\">click me !</a>';
Posted by: Guest on April-12-2021

Code answers related to "javascript make html"

Code answers related to "Javascript"

Browse Popular Code Answers by Language