Answers for "change div in javascript"

7

javascript set text of div

document.getElementById("content").innerHTML = "whatever";
Posted by: Guest on January-17-2020
1

js change div content

let element = document.getElementById("test");
let newContent =`
	<h1>New Title</h1>
	<p>New Content</p>
`;

//changing the content in your element
element.innerHTML = newContent;
Posted by: Guest on June-02-2021

Code answers related to "change div in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language