📘 Lesson · Lesson 01
Introduction to JavaScript
JavaScript का परिचय
What Is JavaScript
JavaScript is the programming language of the web — it makes web pages interactive and alive. If HTML is the structure and CSS is the styling, JavaScript is the BEHAVIOUR: it responds to clicks, updates content without reloading, validates forms, creates animations, fetches data from servers, and powers everything from dropdown menus to full web apps like Gmail. It's a real programming language (with variables, logic, functions, loops) that runs right inside the web browser. Learning it is the step that turns you from someone who builds static pages into someone who builds working applications.
HTML, CSS, and JavaScript — the three-part team
HTML → the STRUCTURE (headings, paragraphs, buttons) — the skeleton
CSS → the STYLE (colours, layout, fonts, spacing) — the appearance
JS → the BEHAVIOUR (clicks, changes, logic, data) — the actions
Remember the house analogy from the HTML course? HTML is the bricks and rooms (structure), CSS is the paint and decoration (style), and JavaScript is the electricity and plumbing — the things that actually DO something when you flip a switch. A light switch (HTML button) looks nice with paint (CSS), but JavaScript is what makes the light actually turn on when clicked. All three work together: HTML builds it, CSS beautifies it, and JavaScript brings it to life. You've learned the first two — now you add the power.
What JavaScript Can Do
- Respond to user actions: do something when a button is clicked, a key is pressed, or the mouse moves.
- Change the page live: update text, images, and styles instantly without reloading — like a "like" count going up.
- Validate forms: check that an email looks right or a password is long enough before submitting.
- Create effects: image sliders, dropdown menus, popups, tabs, and animations.
- Fetch data: load new content from a server in the background (the basis of AJAX, coming later).
- Build full apps: entire applications like Google Docs, Maps, and social media run on JavaScript.
In short, almost every interactive thing you've ever done on a website — anything that changed without the whole page reloading — was JavaScript at work. It is everywhere on the modern web.
Where JavaScript Runs
JavaScript runs inside the web browser — every browser (Chrome, Firefox, Safari, Edge) has a built-in JavaScript "engine" that reads and executes your code. This is powerful: you don't need to install anything special to run JavaScript; the browser your visitors already have does it automatically. When someone opens your web page, their browser runs your JavaScript on THEIR device. (JavaScript can also run on servers using Node.js, which you may explore later — but for this course, we focus on the browser, where JavaScript began and where you'll use it most as a web developer.)
Why Learn JavaScript
JavaScript is the single most important language for web development — and one of the most in-demand skills in tech. Here's why it's worth your time: it's the ONLY programming language that runs natively in every web browser, so every interactive website needs it. It's beginner-friendly (you can see results instantly in your browser), yet powerful enough to build professional applications. It opens doors to front-end development, back-end (Node.js), mobile apps, and more. And crucially, it builds directly on the HTML and CSS you already know. Master JavaScript and you can build almost anything on the web. This course takes you from these very basics all the way to building real, working projects.
Exam Corner
Q: What is JavaScript? The programming language of the web that makes pages interactive and dynamic.
Q: What are the roles of HTML, CSS, and JavaScript? HTML = structure, CSS = style, JavaScript = behaviour/interactivity.
Q: Where does JavaScript run? Inside the web browser (and also on servers via Node.js).
Q: Name three things JavaScript can do. Respond to clicks, update the page without reloading, validate forms (also: effects, fetch data, build apps).
Q: Do you need to install anything to run JavaScript in a browser? No — every browser has a built-in JavaScript engine.
Q: What are the roles of HTML, CSS, and JavaScript? HTML = structure, CSS = style, JavaScript = behaviour/interactivity.
Q: Where does JavaScript run? Inside the web browser (and also on servers via Node.js).
Q: Name three things JavaScript can do. Respond to clicks, update the page without reloading, validate forms (also: effects, fetch data, build apps).
Q: Do you need to install anything to run JavaScript in a browser? No — every browser has a built-in JavaScript engine.
JavaScript क्या है
JavaScript web की programming language है — यह web pages को interactive और जीवंत बनाती है. अगर HTML structure है और CSS styling है, तो JavaScript BEHAVIOUR है: यह clicks का जवाब देती है, reload किए बिना content update करती है, forms validate करती है, animations बनाती है, servers से data लाती है, और dropdown menus से लेकर Gmail जैसे पूरे web apps तक सब कुछ चलाती है. यह असली programming language है (variables, logic, functions, loops के साथ) जो web browser के अंदर चलती है. इसे सीखना वह कदम है जो आपको static pages बनाने वाले से working applications बनाने वाले में बदल देता है.
HTML, CSS, और JavaScript — तीन-हिस्सा team
HTML → STRUCTURE (headings, paragraphs, buttons) — ढांचा
CSS → STYLE (colours, layout, fonts, spacing) — दिखावट
JS → BEHAVIOUR (clicks, changes, logic, data) — क्रियाएं
HTML course का घर वाला analogy याद है? HTML ईंटें और कमरे हैं (structure), CSS पेंट और सजावट है (style), और JavaScript बिजली और plumbing है — वे चीज़ें जो switch दबाने पर असल में कुछ KARTI हैं. Light switch (HTML button) पेंट (CSS) के साथ अच्छा दिखता है, पर JavaScript ही है जो click करने पर light असल में जलाता है. तीनों साथ काम करते हैं: HTML बनाता है, CSS सुंदर करता है, और JavaScript जीवंत करता है. आप पहले दो सीख चुके — अब आप power जोड़ते हैं.
JavaScript क्या कर सकता है
- User actions का जवाब: button click, key press, या mouse move पर कुछ करना.
- Page को live बदलना: reload किए बिना text, images, और styles तुरंत update — जैसे "like" count बढ़ना.
- Forms validate करना: submit से पहले जांचना email सही लगता है या password काफी लंबा है.
- Effects बनाना: image sliders, dropdown menus, popups, tabs, और animations.
- Data लाना: background में server से नया content load करना (AJAX की नींव, आगे).
- पूरे apps बनाना: Google Docs, Maps, और social media जैसे पूरे applications JavaScript पर चलते हैं.
संक्षेप में, website पर आपने जो लगभग हर interactive चीज़ की — कुछ भी जो पूरे page reload के बिना बदला — वह JavaScript का काम था. यह modern web पर हर जगह है.
JavaScript कहां चलता है
JavaScript web browser के अंदर चलता है — हर browser (Chrome, Firefox, Safari, Edge) में built-in JavaScript "engine" होता है जो आपका code पढ़कर execute करता है. यह ताकतवर है: JavaScript चलाने को आपको कुछ खास install करने की ज़रूरत नहीं; आपके visitors के पास जो browser पहले से है वह अपने आप करता है. जब कोई आपका web page खोलता है, उनका browser आपका JavaScript UNKE device पर चलाता है. (JavaScript servers पर भी Node.js से चल सकता है, जो आप बाद में देख सकते हैं — पर इस course में हम browser पर focus करते हैं, जहां JavaScript शुरू हुआ और जहां web developer के रूप में आप इसे सबसे ज़्यादा use करेंगे.)
JavaScript क्यों सीखें
JavaScript web development के लिए सबसे ज़रूरी language है — और tech में सबसे ज़्यादा मांग वाले skills में से एक. यह क्यों आपके समय के लायक है: यह EKMATRA programming language है जो हर web browser में natively चलती है, तो हर interactive website को इसकी ज़रूरत है. यह beginner-friendly है (आप browser में तुरंत नतीजे देख सकते हैं), फिर भी professional applications बनाने लायक ताकतवर. यह front-end development, back-end (Node.js), mobile apps, और ज़्यादा के दरवाज़े खोलती है. और अहम बात, यह सीधे उस HTML और CSS पर बनती है जो आप पहले से जानते हैं. JavaScript master कीजिए और web पर लगभग कुछ भी बना सकते हैं. यह course आपको इन्हीं basics से असली, working projects बनाने तक ले जाता है.
Exam Corner
Q: JavaScript क्या है? Web की programming language जो pages को interactive और dynamic बनाती है.
Q: HTML, CSS, और JavaScript की भूमिकाएं क्या हैं? HTML = structure, CSS = style, JavaScript = behaviour/interactivity.
Q: JavaScript कहां चलता है? Web browser के अंदर (और Node.js से servers पर भी).
Q: JavaScript जो तीन चीज़ें कर सकता है बताइए. Clicks का जवाब, reload बिना page update, forms validate (साथ ही: effects, data लाना, apps बनाना).
Q: क्या browser में JavaScript चलाने को कुछ install करना पड़ता है? नहीं — हर browser में built-in JavaScript engine होता है.
Q: HTML, CSS, और JavaScript की भूमिकाएं क्या हैं? HTML = structure, CSS = style, JavaScript = behaviour/interactivity.
Q: JavaScript कहां चलता है? Web browser के अंदर (और Node.js से servers पर भी).
Q: JavaScript जो तीन चीज़ें कर सकता है बताइए. Clicks का जवाब, reload बिना page update, forms validate (साथ ही: effects, data लाना, apps बनाना).
Q: क्या browser में JavaScript चलाने को कुछ install करना पड़ता है? नहीं — हर browser में built-in JavaScript engine होता है.
💻 Live Code Editor
इस पेज का code यहाँ तैयार है — बदलिए और तुरंत नतीजा देखिए. कुछ install किए बिना.
सब कुछ आपके browser में ही चलता है — कोई server, कोई signup नहीं. JavaScript का
console.log देखने के लिए F12 दबाइए.