JavaScript
JavaScript is a programming language that adds interactivity to websites. You can use it to control just about anything — form data validation, button functionality, game logic, dynamic styling, animation updates, and much more. This article gets you started with JavaScript and walks you through adding some fun features to your first website.
What is JavaScript?
JavaScript is a full-fledged programming language — it contains all the classic programming features you may have seen in other programming languages (or at least heard about), such as variables, loops, and functions.
JavaScript, when used on web pages (though it can also be used in other places), generally works by:
- Getting references to one or more values such as numbers or to elements on the page.
- Doing something with those values, such as adding the numbers together.
- Returning a result that can be used to do something else later on. For example, you might want to display the sum of those numbers on the page.