Your Page Title
πŸ”

    🌟 JavaScript Introduction

    JavaScript is a programming language used to make web pages interactive. It runs in the browser and can do things like:

    • Show/hide content
    • Create image sliders
    • Validate forms
    • Handle user events like clicks or key presses

    πŸ› οΈ Setting Up JavaScript

    You can write JS directly in an HTML file:

    htmlCopyEdit<!DOCTYPE html>
    <html>
    <head>
      <title>JS Intro</title>
    </head>
    <body>
      <h1>Hello, JavaScript!</h1>
      <script>
        alert('Welcome to JavaScript!');
      </script>
    </body>
    </html>
    

    πŸ“š JS Basics (With Examples)

    1. βœ… Variables

    Used to store data.

    jsCopyEditlet name = "Alice";
    const age = 25;
    var city = "New York";
    

    2. πŸ“ Data Types

    jsCopyEditlet text = "Hello";      // String
    let number = 100;        // Number
    let isCool = true;       // Boolean
    let nothing = null;      // Null
    let something;           // Undefined
    let items = [1, 2, 3];   // Array
    

    3. πŸ” Functions

    jsCopyEditfunction greet(name) {
      console.log("Hello, " + name);
    }
    
    greet("Sam");
    

    4. πŸ”„ Conditional Statements

    jsCopyEditlet age = 20;
    
    if (age >= 18) {
      console.log("You are an adult");
    } else {
      console.log("You are a minor");
    }
    

    5. πŸ”ƒ Loops

    jsCopyEditfor (let i = 1; i <= 5; i++) {
      console.log("Count: " + i);
    }
    

    6. πŸ“¦ Objects

    jsCopyEditlet person = {
      name: "John",
      age: 30,
      isStudent: false
    };
    
    console.log(person.name); // Output: John
    

    πŸ–±οΈ Interacting with the Browser (DOM)

    Example: Changing content on click

    htmlCopyEdit<p id="demo">Hello!</p>
    <button onclick="changeText()">Click Me</button>
    
    <script>
      function changeText() {
        document.getElementById("demo").innerHTML = "You clicked the button!";
      }
    </script>
    

    πŸš€ Next Steps

    1. Practice: Build small things like a counter, a to-do list, or a quiz.
    2. Learn more:

    Would you like me to turn this into a mini-course or build a beginner project (like a calculator or to-do list) with you step-by-step?