Wednesday, 10 May 2017

button click text change

<!DOCTYPE html>
<html>
<!-- <script src="https://www.w3schools.com/lib/w3.js"></script> -->
<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>

No comments:

Post a Comment