Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • jQuery Tutorial
  • jQuery Selectors
  • jQuery Events
  • jQuery Effects
  • jQuery Traversing
  • jQuery HTML & CSS
  • jQuery AJAX
  • jQuery Properties
  • jQuery Examples
  • jQuery Interview Questions
  • jQuery Plugins
  • jQuery Cheat Sheet
  • jQuery UI
  • jQuery Mobile
  • jQWidgets
  • Easy UI
  • Web Technology
Open In App
Next Article:
Difference between C++ and JavaScript
Next article icon

Difference Between JavaScript and jQuery

Last Updated : 06 Mar, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

JavaScript is a programming language used for web development, while jQuery is a library written in JavaScript, simplifying tasks like DOM manipulation, event handling, and AJAX requests, making JavaScript code more concise and readable.

JavaScript

JavaScript is a crucial scripting language for enhancing website interactivity and responsiveness. It complements HTML and CSS, adding dynamism to web pages. Besides web development, JavaScript powers desktop/server programs (e.g., Node.js) and certain databases like MongoDB and CouchDB.

Example: This example uses the Javascript loop concept to print the numbers.

HTML




<!DOCTYPE html>
<html lang="en">
 
<head>
    <title>
        Difference Between JavaScript and jQuery
    </title>
</head>
 
<body>
    <p>A loop with a
        <mark>continue</mark> statement.
    </p>
    <p>
        loop will skip the iteration where k = 7.
    </p>
    <p id="maddy"></p>
    <script>
        let text = "";
        let k;
        for (k = 0; k < 10; k++) {
            if (k === 7) {
                continue;
            }
            text += "The number is " + k + "<br>";
        }
        document.getElementById("maddy").innerHTML = text;
    </script>
</body>
 
</html>
 
 

Output:

JavaScript Output

jQuery

JQuery is a framework for JavaScript developed from JavaScript. It is the most popular JavaScript library invented by John Resign and was released in January 2006 at BarCamp NYC. It is a free, open-source library and It’s a fast, concise, and rich-featured JavaScript library and also has cross-browser compatibility. The purpose of jQuery is to make life easier for the masses so that they can easily develop websites and browser-based applications using JavaScript. In a concise manner, we can say that “JQuery is a library to provide better client-side web page development” environment to the developer with the help of its feature-rich library.

  • DOM manipulation: DOM elements can be easily traversed, and forbrowser’s modified.
  • Animations Lots of built-in features for animations.
  • HTML event handling and manipulation.
  • Ajax is much simpler with an easy-to-use API that works across a multitude of browsers.
  • CSS manipulation
  • Has a high-level UI widget library.
  • Cross-browser support: work well on browsers like Chrome, Opera, etc.
  • Lightweight: Only 19kb in size.
  • And other common utilities

Example: This example uses the show() method & hide() method to toggle the element to display.

HTML




<!DOCTYPE html>
<html lang="en">
<head>
    <title>
        Difference Between JavaScript and jQuery
    </title>
    <script src=
"https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js">
    </script>
</head>
 
<body>
    <script>
        $(document).ready(function () {
            $("#hide").click(function () {
                $("h1").hide();
            });
            $("#show").click(function () {
                $("h1").show();
            });
        });
    </script>
    <h1>
        <mark>
            On clicking the "Hide_me" button, I will disappear.
        </mark>
    </h1>
    <button id="hide">Hide_me</button>
    <button id="show">Show_me</button>
</body>
</html>
 
 

Output: As we click on the Hide_me button, the above-marked heading will disappear, but as soon as we click on the Show_me button it’ll again appear.

Toggle to view the hidden element

Key differences between JavaScript and JQuery are as follows

 JavaScript

jQuery

JavaScript uses JIT[Just in Time Compiler] which is a combination of interpreter and Compile and is written in C. It’s a combination of ECMA script and DOM (Document Object Model).

While JQuery Uses the resources that are provided by JavaScript to make things easier. It is a lightweight JavaScript library. It has only the DOM.

JavaScript uses long lines of code as an individual has to write the code own-self.

With JQuery, one has to write fewer lines of code than JavaScript. We just need to import the library and use the only specific functions or methods of the library in our code.

In JavaScript, we have to write extra code or move around to have cross-browser compatibility.

JQuery has an inbuilt feature of cross-browser compatibility. We don’t need to worry about writing extra lines of code or moving around in order to make our code compatible with any browser.

JavaScript can be a burden over a developer as it may take a number of lines of lengthy code to attain functionality.

Unlike JavaScript, JQuery is more user-friendly only a few lines of code have to write in order to have its functionality.

JavaScript is verbose because one has to write their own scripting code which is time-consuming.

JQuery is concise and one need not write much as scripting already exists.

Pure JavaScript can be faster for DOM selection/manipulation than jQuery as JavaScript is directly processed by the browser and it curtails the overhead which JQuery actually has.

JQuery is also fast with modern browsers and modern computers. JQuery has to be converted into JavaScript to make it run in a browser.

We can make animations in JavaScript with many lines of code. Animations are mainly done by manipulating the style of an Html page.

In JQuery, we can add animation effects easily with fewer lines of code.

JavaScript is a language, obviously, it would be heavier than JQuery.

While JQuery is a library, derived from JavaScript hence, it is lightweight.

JavaScript is an independent language and can exist on its own.

JQuery is a JavaScript library. It would not have been invented had JavaScript was not there. jQuery is still dependent on JavaScript as it has to be converted to JavaScript for the browser in-built JavaScript engine to interpret and run it.

Brendan Eich created JavaScript at Netscape. jQuery is created by John Resig.
JavaScript is a programming language. jQuery is an Application Programming Interface (API).
There are no special symbols to define JavaScript like JQuery. There are special symbols to define JQuery.
The disadvantage of JavaScript is that it is not easy to use it. The advantage of JQuery is the ease in which one can use JQuery.

Advantages of JavaScript

  • JavaScript boosts up the execution of a program and saves the time required for connecting to the server.
  • It provides numerous interfaces to developers for creating catchy web pages.
  • It is capable of back-end as well as front-end development.
  • The structure of JavaScript is simple for the users as well as the developers.

Disadvantages of JavaScript

  • It runs the risk of lower security.
  • It takes a longer time to load if too much JavaScript content is added to the website.
  • As it is a client-side language, There may be slight differences in the performance depending on the browsers.
  • Disabling JavaScript can hinder a web page.

Advantages of jQuery:

  • jQuery is immensely flexible as it permits users to add plugins.
  • It has inbuilt UI and effects libraries.
  • It can perform complicated JavaScript operations in very less code.
  •  It is free, supported well across different applications, and also provides very efficient and fast solutions to problems.

Disadvantages of jQuery

  • Functionality is limited.
  • The library is quite huge to download.
  • It have issues in working with certain browsers.

jQuery is an open-source JavaScript library that simplifies the interactions between an HTML/CSS document, It is widely famous for its philosophy of “Write less, do more”. Please refer to the jQuery Tutorial and jQuery Examples articles for further details.



Next Article
Difference between C++ and JavaScript
author
madhav_mohan
Improve
Article Tags :
  • Difference Between
  • JavaScript
  • JQuery
  • Web Technologies
  • JavaScript-Questions
  • jQuery-Questions
  • Web Technologies - Difference Between

Similar Reads

  • Difference between JavaScript and JSP
    JavaScript is a lightweight and object-oriented scripting language used to create dynamic HTML pages with interactive effects within a webpage. It is an interpreted scripting language and its code is run in a web browser. It is also called a browser’s language and can be used for client-side develop
    3 min read
  • Difference between Node.js and JavaScript
    JavaScript and Node.js are both crucial in modern web development, but they serve different purposes and are used in different environments. JavaScript is a programming language primarily used for client-side web development, while Node is a runtime environment that allows JavaScript to be executed
    3 min read
  • Difference between JavaScript and PHP
    In this article, we will know about Javascript & PHP, along with understanding their significant differences. A long time before, most people used to think PHP is a server-side language and Javascript as client-side language as it was only executed in web browsers. But after V8, Node and other f
    4 min read
  • Difference between C++ and JavaScript
    1. C++ :C++ or CPP is a general-purpose statically typed object-oriented programming language. In 1980, C++ was developed by Bjarne Stroustrup at bell laboratories of AT&T (American Telephone & Telegraph) as an extension to the C language. This seed has expanded since then and had become one
    3 min read
  • Difference between Python and JavaScript
    Python and JavaScript are both popular programming languages, each with distinct features. Python emphasizes readability and simplicity, ideal for tasks like data analysis and backend development, while JavaScript is primarily used for web development, offering dynamic and interactive functionality
    4 min read
  • Difference Between JavaScript and React.js
    JavaScript is a versatile programming language widely used for creating interactive web pages and web applications. It is essential for front-end development, allowing developers to manipulate webpage elements, handle user interactions, and dynamically update content. On the other hand, React.js is
    4 min read
  • Difference between CSS and JavaScript
    CSS and JavaScript are two fundamental technologies used in web development, each serving a unique purpose. While CSS enhances the visual appeal of a webpage, JavaScript adds interactivity and dynamic content. This article will delve into the differences between these two technologies, shedding ligh
    3 min read
  • Difference between JavaScript and C Sharp
    These days, as no one can get absent with learning fair a single dialect, it does not matter which one you begin with. Having the information of both JavaScript vs C# will as it were advantageous in the long run. Generally, one must type in so numerous lines of code in C# like Java to induce things
    3 min read
  • Difference between TypeScript and JavaScript
    Ever wondered about the difference between JavaScript and TypeScript? If you're into web development, knowing these two languages is super important. They might seem alike, but they're actually pretty different and can affect how you code and build stuff online. In this article, we'll break down the
    4 min read
  • Difference between JavaScript and HTML
    JavaScriptJavaScript is a programming language that conforms to the ECMAScript specification. It is a high-level scripting language introduced by Netscape to be run on the client-side of the web browser. It can insert dynamic text into HTML. JavaScript is also known as the browser’s language. HTMLHT
    2 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences