JavaScript Introduction
JavaScript is the world's most popular programming language. It is the language for the Web, for computers, servers, and more.
Why Study JavaScript?
JavaScript is one of the 3 languages all web developers must learn:
- HTML to define the content of web pages
- CSS to specify the layout of web pages
- JavaScript to program the behavior of web pages
Example
JavaScript can change HTML content. One of many JavaScript HTML methods is getElementById().
html
<p id="demo">JavaScript can change HTML content.</p>
<button type="button" onclick='document.getElementById("demo").innerHTML = "Hello JavaScript!"'>Click Me</button>Test Yourself with an Exercise
Inside which HTML element do we put the JavaScript?