change text of element js
snippet in javascript

change text of element js

user8580

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

change p tag text javascript

user5106


<html>

<body>


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


<script>

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

</script>


</body>

</html>