KOSUNI KOREA
Korean News in English
Technology

jQuery Basics: What It Is and Why You Should Learn It

Published October 17, 2026 · 1 views
jQuery Basics: What It Is and Why You Should Learn It

Welcome.

In this course, we'll be learning jQuery web programming together.

When starting web development, beginners typically learn to create layouts with HTML and CSS, then add interactivity using JavaScript.

However, writing code solely in JavaScript often leads to lengthy and complex scripts.

This is where jQuery comes in. jQuery is a library designed to make JavaScript easier and more concise, and it has been one of the most widely used technologies among web developers worldwide for many years.

While modern frameworks like React and Vue are increasingly popular today, jQuery remains actively used in admin panels, corporate websites, e-commerce platforms, and WordPress plugins across countless projects.

Therefore, learning jQuery is valuable whether you're starting your web development journey or maintaining existing projects.


What Is jQuery?

jQuery is a library built with JavaScript.

In simple terms, it's a tool that helps developers use JavaScript more easily and quickly.

Before jQuery, browser-specific differences in JavaScript behavior caused many headaches for developers.

jQuery addressed these inconsistencies and made complex code significantly shorter and more readable.

For example, registering a button click event is much simpler with jQuery than with plain JavaScript.

JavaScript

document.getElementById("btn").addEventListener("click", function () {
    alert("Hello.");
});

jQuery

$("#btn").click(function () {
    alert("Hello.");
});

Both codes achieve the same result, but jQuery's version is noticeably more concise.


Why Learn jQuery Today?

Many ask: "With React available, is learning jQuery still worthwhile?"

The answer is absolutely yes.

Here's why:

  • It's still widely used in many corporate websites.

  • One of the most common libraries in admin panels.

  • Most WordPress plugins are built on jQuery.

  • Frequently used in e-commerce solutions.

  • Commonly encountered when maintaining legacy projects.

In practice, developers often spend more time modifying existing projects than building new ones. Understanding jQuery gives you a significant advantage in these scenarios.


Setting Up Your Development Environment

This course uses the following tools:

  • VS Code

  • Google Chrome

  • Live Server extension

First, install VS Code and create a new folder (e.g., named jquery-study).

jquery-study

Create an index.html file inside this folder.


Creating Basic HTML Structure

Start by writing a standard HTML document:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>jQuery Basics</title>
</head>
<body>

<h1>jQuery Learning</h1>

</body>
</html>

This is a standard HTML document. Now we'll add jQuery to it.


How to Install jQuery

There are two main ways to use jQuery:

The first method uses CDN (Content Delivery Network), which is the most common approach. It loads jQuery directly from the internet.

<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>

The advantage is simplicity—you can always use the latest version without installation.

However, it requires an internet connection.

The second method involves downloading jQuery directly and storing it in your project folder:

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

This approach works offline but requires manual file management.

For beginners, the CDN method is recommended.


Adding jQuery to Your Project

Add the following code at the very bottom of your body tag:

<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>

Then add a script tag below it for your code:

<script>

</script>


Your First jQuery Program

To verify your installation, write this code:

$(function () {

    alert("jQuery is working correctly.");

});

If an alert appears when you open the page, your installation was successful.


The Meaning of $(function(){})

This pattern appears frequently in jQuery:

$(function () {

});

This code means: "Execute the inner code after the HTML document is fully loaded." It serves a similar purpose to JavaScript's DOMContentLoaded event.

You'll use this pattern in almost all examples going forward, so be sure to remember it.


Using Live Server

Install the Live Server extension in VS Code. After installation, right-click on your index.html file and select Open with Live Server.

This will automatically open your browser and refresh the page whenever you save changes, significantly speeding up development.


Checking Console Output

Press F12 in Chrome to open Developer Tools, then select the Console tab.

Enter this code:

$(function () {

    console.log("Hello jQuery");

});

If "Hello jQuery" appears in the console, your setup is working correctly.


Creating a Button Click Event

Let's create a button:

<button id="btn">Click Me</button>

Add this code below the script tag:

$(function () {

    $("#btn").click(function () {

        alert("Button clicked!");

    });

});

If an alert appears when you click the button, your implementation was successful.


Common Beginner Mistakes

  • Writing code before jQuery loads (always load jQuery first)

  • Misnaming IDs in HTML vs. JavaScript

  • Forgetting to use $(function(){}) and having code execute before the DOM is ready

It's recommended to always include $(function(){}) as a habit from the start.


Practice Exercises

Exercise 1

Write code that outputs "Hello jQuery" in the console.

Exercise 2

Create a button that shows an alert with "Hello" when clicked.

Exercise 3

Create two buttons, each displaying different messages when clicked.


Key Takeaways

  • jQuery is a JavaScript library.

  • It allows writing shorter and cleaner code compared to plain JavaScript.

  • Install via CDN or download directly.

  • $(function(){}) executes code after the HTML document loads.

  • Using Live Server with Chrome Developer Tools makes learning more efficient.


Closing Thoughts

In this lesson, we've covered what jQuery is, why it's still relevant, and how to set up your development environment.

While our examples were simple so far, you'll soon learn selectors, events, animations, AJAX, and more—giving you full control over web pages.

In the next lesson, we'll dive into jQuery Selectors: A Complete Guide, exploring how to select and manipulate elements on a webpage.

FAQ

Is jQuery still used today?

Yes, it remains widely used in corporate websites, admin panels, WordPress plugins, and e-commerce solutions.

Should beginners learn jQuery before React or Vue?

Learning jQuery first can be helpful as a foundation for understanding JavaScript concepts before moving to modern frameworks.

Korean Source

This article is an English localization of a Korean-language report from BlogScore. Original: [jQuery 강좌] 1강 jQuery란 무엇인가? 왜 사용하는가? 설치와 개발 환경 구축