JavaScript Introduction

JavaScript Introduction
JavaScript Introduction (JS) is a scripting language used to make web pages interactive, dynamic, and functional.
It runs directly in the browser and works with HTML & CSS to create modern websites.
How JavaScript Works with Web Technologies
| Technology | Purpose |
|---|---|
| HTML | Structure of webpage |
| CSS | Appearance / styling |
| JavaScript | Behavior / interactivity |
Example:
HTML creates a button → CSS styles it → JavaScript makes it clickable.
What Can JavaScript Do?
- Change HTML content
- Change CSS styles
- Respond to user actions (click, input, scroll)
- Validate forms
- Create animations, popups, sliders
- Communicate with servers (APIs)
- Build full applications (like Facebook, Gmail)
JavaScript Syntax Example
Inline JavaScript:
Internal JavaScript:
External JavaScript (recommended):
Simple Example Showing Output
Why Learn JavaScript?
Because with JavaScript you can build:
Websites
Mobile apps
Games
Server applications (Node.js)
Desktop apps (Electron.js)
Fun Fact
➡️ JavaScript was created in just 10 days in 1995.
➡️ Today, it’s one of the most popular programming languages in the world.
