DarioP
0
Q:

javascript innerhtml

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

<html>

<body>


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


<script>

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

</script>


</body>

</html>
 
-2
table.innerhtml
-2

New to Communities?

Join the community