An Intro to jQuery

HTML, CSS, and JavaScript are the three basic web languages. We build our websites with HTML, style them with CSS, and add JavaScript for interactive functionality. 

JQuery is a JavaScript library. It is not a programming language, but it is a tool used to write standard JavaScript short tasks. jQuery has the added advantage of working with a shortcut.


Hello World!

By comparing the word “Hello, World!” Program on both JavaScript and jQuery, See the difference.


javascript:

document.getElementById("demo").innerHTML = "Hello, World!";

jQuery:

$("#demo").html("Hello, World!");

How to add jQuery to a web project

jQuery is a JavaScript file that you will link to in your HTML. There are two ways to install jQuery in a project:

  1. Downloada local copy.
  2. Link to a file via Content Delivery Network (CDN).

JQuery CDN

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


HTML structure and save it as index.html.

<!doctype html>
<html lang="en">
    <head>
        <title>jQuery Demo</title>
    </head>
    <body>

        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
        <script>
            //write your query code  here

        </script>
    </body>
</html>