In the beginning, the web was static. All you could do as a developer was write text (with HTML) and make websites look nice (with CSS).
Users could only interact with your website through links that brings a user from one page to another. Most of the time, these are blue underlined text, but they can be of other colors.
People had a vision that the web could become more interactive — things can move, animations can exist, and more stuff can happen — these thoughts prompted the development of JavaScript.
What you’ve just read is a short and informal history of JavaScript which serves to help you build up your understanding of what’s to come.
Of course, you’re here to learn JavaScript, not history, so we won’t go into any more history lessons from this point onwards. If you’re interested in a long and detailed history, check out a brief history of JavaScript.
JavaScript makes things dynamic
JavaScript allows three things to happen.
First, it allows you to detect user interaction, which allows your website to respond according to a user’s action.
For example, when a user clicks on a tab in the the tabbed interfaced below, what’s shown on screen changes to reflect what the tab contains.
Second, JavaScript lets you change the structure of your HTML and CSS. In the example below, when the button gets clicked, a class called red appears in the Document Object Model (the DOM), which is your HTML in the browser.
Third, JavaScript lets you create animations like any of the following:
JavaScript does much more than these three things
JavaScript isn’t just about making things dynamic on browsers anymore. It can be used on the server too. In the next lesson, you’ll learn more about the JavaScript ecosystem and how to navigate your way around it.
Welcome! Unfortunately, you don’t have access to this lesson. To get access, please purchase the course or enroll in Magical Dev School.
Unlock this lesson