Skip to main content

Command Palette

Search for a command to run...

Introduction to JavaScript – Making Websites Interactive

Updated
4 min readView as Markdown

The first 30 days of my #100DaysOfCode journey were all about building a strong frontend foundation.

I learned HTML to structure webpages and CSS to style them and create responsive layouts.

Today, I begin the next chapter—JavaScript.

If HTML is the skeleton of a webpage and CSS is its appearance, then JavaScript is what brings it to life by adding logic and interactivity.

Let's begin.


What is JavaScript?

JavaScript is a high-level, lightweight, interpreted programming language used to make websites interactive and dynamic.

It allows developers to:

  • Respond to user actions

  • Manipulate webpage content

  • Validate forms

  • Create animations

  • Fetch data from servers

  • Build complete web applications

Today, JavaScript is one of the most widely used programming languages in the world.


Why Do We Need JavaScript?

Imagine a webpage built only with HTML and CSS.

It looks beautiful, but nothing changes when a user interacts with it.

JavaScript makes websites interactive by enabling features like:

  • Login forms

  • Dark mode toggles

  • Image sliders

  • Dropdown menus

  • Live search

  • Shopping carts

  • Real-time notifications

Without JavaScript, websites would remain static.


The Three Pillars of Frontend Development

Modern frontend development is built on three core technologies:

🧱 HTML

Provides the structure and content.

🎨 CSS

Controls the appearance and layout.

⚡ JavaScript

Adds logic, behavior, and interactivity.

Together, these technologies power nearly every website on the internet.


A Brief History of JavaScript

JavaScript was created by Brendan Eich in 1995 while working at Netscape.

Interestingly, it was developed in just 10 days.

Over the years, JavaScript has evolved significantly and is now standardized under ECMAScript (ES).

Today, modern JavaScript includes powerful features introduced in versions like ES6, making development cleaner and more efficient.


Where Can JavaScript Run?

Originally, JavaScript only ran inside web browsers.

Today, it can also run outside the browser using Node.js, enabling developers to build servers, APIs, desktop applications, and command-line tools.

This means JavaScript is now used for both frontend and backend development.


Ways to Add JavaScript

Similar to CSS, JavaScript can be included in three ways.

1. Inline JavaScript

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

Useful for simple examples but not recommended for large projects.


2. Internal JavaScript

<script>

console.log("Hello JavaScript");

</script>

Written inside the HTML file.


3. External JavaScript

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

This is the preferred approach for real-world projects because it keeps HTML and JavaScript separate.


Your First JavaScript Program

The most commonly used statement while learning JavaScript is:

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

console.log() prints output to the browser's developer console.

It's one of the most useful tools for debugging and understanding how your code works.


Browser Developer Tools

To see JavaScript in action:

  1. Open your webpage.

  2. Press F12 or Ctrl + Shift + I.

  3. Go to the Console tab.

  4. Write:

console.log("Learning JavaScript 🚀");

The message will appear in the console.


Best Practices

✔ Keep HTML, CSS, and JavaScript in separate files.

✔ Use meaningful variable names.

✔ Practice writing small programs every day.

✔ Use the browser console for debugging.

✔ Focus on understanding concepts rather than memorizing syntax.


My Biggest Takeaway

For the past month, I've been building websites that looked good.

Today, I took the first step toward building websites that can think, respond, and interact with users.

JavaScript opens the door to dynamic web development, and I'm excited to learn how logic and programming come together to create real-world applications.

This feels like the beginning of an entirely new chapter in my journey.

4 views

100 Days of Code: My Journey to Becoming a Full Stack Developer

Part 31 of 50

Welcome to my 100 Days of Code journey! In this series, I'll document my daily progress as I learn Full Stack Web Development from the ground up. Every post will cover what I learned, challenges I faced, mistakes I made, and the projects I built. My goal is not just to complete 100 days but to become a better developer through consistency, discipline, and learning in public. Topics I'll cover include: • Git & GitHub • HTML, CSS & JavaScript • React.js • Node.js & Express • MongoDB • APIs • Real-world Projects • AI tools for Developers Whether you're just starting out or revising your fundamentals, I hope this journey helps you learn alongside me. Let's build, learn, and grow together! 🚀

Up next

Variables & Data Types in JavaScript

Yesterday, I started my JavaScript journey by understanding what JavaScript is and how it brings websites to life. Today, I explored one of the most fundamental concepts in programming—Variables and D

More from this blog

T

TheSaurceCode

73 posts

Documenting my journey to becoming a Full Stack Developer through daily blogs, coding challenges, projects, tutorials, and lessons learned. Learn, build, and grow with me