answer action

Can’t find an answer?

Make use of a qualified tutor to get the answer

adrian
99
Q:

Html : .innerhtml

Features

Html
document.getElementById("Test").innerHTML = "<h1>Test</h1>"; 
1
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
Your Answer

New to Communities?

Join the community