How JavaScript can change HTML content

Javascript / Fundamentals of Javascript

484

Program:

<!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:

Run Above Code

Explanation:

no

This Particular section is dedicated to Programs only. If you want learn more about Javascript. Then you can visit below links to get more depth on this subject.