Pages

Lesson 1 - #JavaScript

JavaScript Can Change HTML Content
One of many JavaScript HTML methods is getElementById().
This example uses the method to "find" an HTML element (with id="firsttime") and changes the element content (innerHTML) to "Hello JavaScript":
<html>
<body>
<h1>What Can JavaScript Do?</h1>
<p id="firsttime">JavaScript can change HTML content.</p>
<button type="button" onclick='document.getElementById("firsttime").innerHTML = "Hello JavaScript!"'>Click Me!</button>
</body>
</html>
Try it your self...
Every day more to learn for #JavaScript , #webdesign and #webdevelopment
Join me to create together amazing things in web development...

No comments:

Post a Comment