adrian
98
Q:

.innerhtml

document.getElementById("Test").innerHTML = "<h1>Test</h1>"; 
0
document.getElementById("Test").innerHTML = "<p style='color:red;'>Test</p>";
1
// .innerHTML method is used to change the html contents of a DOM object
document.getElementById("demo").innerHTML = "Paragraph changed!";
5

document.getElementById("demo").innerHTML = "";  // Replaces the content of <p> with an empty string 
3
document.getElementById("example").innerHTML = "Paragraph changed!";
1

 var x = document.getElementById("myList").innerHTML; 
0

 alert(document.getElementById("demo").innerHTML); 
0

 document.getElementById("myP").innerHTML = "Hello Dolly.";

 document.getElementById("myDIV").innerHTML = "How are you?"; 
0

<html>

<body>


<p id="p1">Hello World!</p>


<script>

document.getElementById("p1").innerHTML = "New text!";

</script>


</body>

</html>
 
-2

New to Communities?

Join the community