Programming Code Center(PCC)
[JS]

(PCC)::[how-to-use-JavaScript-to-change-HTML-content-with-output]::[js]

File Name : index.html

<!DOCTYPE html>
<html>
<body>

<h2>What Can JavaScript Do?</h2>

<p id="demo">JavaScript can change HTML content.</p>

<button type="button" onclick='document.getElementById("demo").innerHTML = "Hello JavaScript!"'>Click Me!</button>

</body>
</html>

Output :

What Can JavaScript Do?

JavaScript can change HTML content.