JavaScript Introduction
JavaScriptJavaScript is the programming language of the web. It makes websites interactive — buttons that click, forms that validate, content that updates without reloading.
What Can JavaScript Do?
- Change HTML content and styles
- React to user events (clicks, typing)
- Validate form data
- Create animations and games
- Build full applications (React, Node.js)
Example — JAVASCRIPT
// Show a message
alert("Hello, World!");
// Change page content
document.getElementById("demo")
.innerHTML = "JavaScript is fun!";
// Log to console (for debugging)
console.log("Page loaded!");
// Simple calculation
let price = 100;
let tax = price * 0.18;
console.log("Tax: ₹" + tax);
Result
▶ Alert: "Hello, World!"
▶ Element updated: "JavaScript is fun!"
▶ Console: "Page loaded!"
▶ Console: "Tax: ₹18"
▶ Element updated: "JavaScript is fun!"
▶ Console: "Page loaded!"
▶ Console: "Tax: ₹18"