Chapter 3: JavaScript Basics

Lesson 1: Introduction to JavaScript

JavaScript adds interactivity and dynamic behavior to your web pages. It can respond to user actions, modify content, and more.

Let's create a simple alert:

  1. Add the following just before the closing tag in your index.html:


<script>
    alert("Welcome to my website!");
</script>


    1. Save and refresh your page.

    An alert box should pop up when you open the page!