Answers for "how to replace element in html"

0

Change the HTML of an element

const content=document.querySelector('.content');
content.innerHTML='<h2 style="background:orange; color:blue; font-family:monospace">This is the new Header</h2>';
Posted by: Guest on December-11-2021
1

change html element

element.innerHTML =  "<p>read this</p>"	Change the inner HTML of an element
element.style.color = "blue";			Change the style of an HTML element
element.setAttribute(important, "true")	Change the attribute value of an HTML element
element.important = "true"				Change the attribute value of an HTML element
Posted by: Guest on November-19-2020

Code answers related to "how to replace element in html"

Browse Popular Code Answers by Language