📲 Download Utility Tools Apps

EMI Calculator

Download EMI Calculator

SOA Games

Download SOA Games

SOA Technology App

Download SOA Technology

BMI Checker

Download BMI Checker

Task Jira

Download Task Jira

Laughing Adda

Download Laughing Adda

📅 हिंदी कैलेंडर ऐप डाउनलोड करें

Download Shubhcalendar App

1️⃣ Introduction to JavaScript

✅ What is JavaScript?

JavaScript is a programming language used to make websites interactive and dynamic.

👉 Without JavaScript:

  • Website = Static (only text, images)

👉 With JavaScript:

  • Buttons respond
  • Forms validate
  • Animations work
  • Data updates without reload

📌 Example:

<button onclick="alert('Hello!')">Click Me</button>

📜 History of JavaScript

  • Created in 1995 by Brendan Eich
  • Developed at Netscape
  • Initially called Mocha, then LiveScript
  • Finally named JavaScript

👉 Important:

  • JavaScript is NOT Java
  • Name was for marketing 😄

📈 Today:

  • Runs in browsers
  • Also runs on servers (Node.js)

⚔️ JavaScript vs HTML vs CSS

TechnologyPurpose
HTMLStructure (Skeleton)
CSSDesign (Styling)
JavaScriptBehavior (Brain)

👉 Example:

<h1>Hello</h1>      <!-- HTML -->
<style>h1{color:red}</style> <!-- CSS -->
<script>alert('Hi')</script> <!-- JavaScript -->

🌐 How JavaScript Works in Browser

  1. Browser loads HTML
  2. Parses HTML → creates DOM
  3. Loads CSS
  4. Executes JavaScript

👉 JavaScript can:

  • Change HTML
  • Change CSS
  • Handle events

📌 Example:

<p id="demo">Hello</p><script>
document.getElementById("demo").innerHTML = "Changed!";
</script>

⚙️ JavaScript Engines

JavaScript engine = program that runs JS code

Popular Engines:

  • V8 → Chrome, Edge
  • SpiderMonkey → Firefox
  • JavaScriptCore → Safari

👉 What engine does:

  • Reads code
  • Converts to machine code
  • Executes fast

🧪 Writing First JavaScript Program

👉 Example:

console.log("Hello, World!");

📌 Output:

  • Appears in browser console

👉 Another example:

alert("Welcome to JavaScript!");

🔗 Adding JavaScript to HTML

There are 3 ways:


1️⃣ Inline JavaScript

👉 JS written inside HTML tag

<button onclick="alert('Clicked!')">Click</button>

📌 Use:

  • Small actions

❌ Not recommended for large projects


2️⃣ Internal JavaScript

👉 JS written inside <script> tag

<!DOCTYPE html>
<html>
<head>
</head>
<body><script>
alert("Internal JS");
</script></body>
</html>

📌 Best for:

  • Small to medium scripts

3️⃣ External JavaScript

👉 JS in separate .js file

HTML:

<script src="script.js"></script>

script.js:

alert("External JS");

📌 Best for:

  • Large projects
  • Clean code
  • Reusability

🚀 Summary

  • JavaScript makes websites interactive
  • Works with HTML & CSS
  • Runs inside browser using engines
  • Can be added in 3 ways:
    • Inline
    • Internal
    • External (best practice)


AI Spiritual Tools & Interactive Experiences

Explore powerful AI-driven tools for daily guidance, spirituality, fun quizzes, and self-discovery.

Today’s Quote

Get inspiring daily quotes powered by AI to motivate and guide your day.

Explore Now

AI Tarot Card Reader

Reveal insights about your future, love, and career with AI tarot readings.

Read Tarot

Love Match Calculator

Check compatibility and love predictions using AI-based analysis.

Check Match

Fortune Cookie

Open an AI fortune cookie and receive wisdom, luck, and fun messages.

Open Cookie

Quiz Categories

Engage with knowledge-based and fun quizzes across multiple categories.

Start Quiz

Panchang Calendar

View daily Panchang, auspicious timings, tithi, nakshatra, and festivals.

View Panchang

Online Numerology

Discover your destiny number, life path, and numerology predictions.

Calculate Now

Spiritual Feeds

Stay connected with spiritual thoughts, mantras, and divine content.

View Feeds

Quiz Hub

Attempt trending quizzes on GK, spirituality, festivals, and more.

Explore Quizzes