Answers for "js innerhtml add"

4

js innerHTML

document.getElementById("Test").innerHTML = "<p style='color:red;'>Test</p>";
Posted by: Guest on December-04-2020
-1

innerHTML js

const eleId = "ElementID" // ID from a element like div, etc.
document.getElmentById(eleId).innerHTML = "New element content!"; // Changes the element with the eleId to the new content
Posted by: Guest on January-04-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language