• Home
  • Jobs
  • Courses
  • Certifications
  • Companies
  • Online IDE
  • Login
  • Signup
MYTAT
  • Home
  • Jobs
  • Courses
  • Certifications
  • Companies
  • Online IDE
  • Login
  • Signup
JavaScript
  • JavaScript Introduction
  • JavaScript Where To
  • JavaScript Output
  • JavaScript Statements
  • JavaScript Syntax
  • JavaScript Comments
  • JavaScript Variables
  • JavaScript Let
  • JavaScript Const
  • JavaScript Operators
  • JavaScript Assignment
  • JavaScript Data Types
  • JavaScript Functions
  • JavaScript Objects
  • JavaScript Events
  • JavaScript Strings
  • JavaScript String Methods
  • JavaScript Numbers
  • JavaScript Number Methods
  • JavaScript Arrays
  • JavaScript Array Const
  • JavaScript Array Methods
  • JavaScript Sorting Arrays
  • JavaScript Array Iteration
  • JavaScript Date Objects
  • JavaScript Date Formats
  • JavaScript Get Date Methods
  • JavaScript Set Date Methods
  • JavaScript Math Object
  • JavaScript Random
  • JavaScript Booleans
  • JavaScript Comparison And Logical Operators
  • JavaScript If Else And Else If
  • JavaScript Switch Statement
  • JavaScript For Loop
  • JavaScript Break And Continue
  • JavaScript Type Conversion
  • JavaScript Bitwise Operations
  • JavaScript Regular Expressions
  • JavaScript Errors
  • JavaScript Scope
  • JavaScript Hoisting
  • JavaScript Use Strict
  • The JavaScript This Keyword
  • JavaScript Arrow Function
  • JavaScript Classes
  • JavaScript JSON
  • JavaScript Debugging
  • JavaScript Style Guide
  • JavaScript Common Mistakes
  • JavaScript Performance
  • JavaScript Reserved Words
  • JavaScript Versions
  • JavaScript History
  • JavaScript Forms
  • JavaScript Validation API
  • JavaScript Objects
  • JavaScript Object Properties
  • JavaScript Function Definitions
  • JavaScript Function Parameters
  • JavaScript Function Invocation
  • JavaScript Closures
  • JavaScript Classes
  • Java Script Async
  • JavaScript HTML DOM
  • The Browser Object Model
  • JS Ajax
  • JavaScript JSON
  • JavaScript Web APIs
  • JS Vs JQuery
  • Home
  • Courses
  • JavaScript
  • JS Vs JQuery

JS vs jQuery

Previous Next

JavaScript / JQuery DOM Selectors

jQuery vs JavaScript

jQuery was created in 2006 by John Resig. It was designed to handle Browser Incompatibilities and to simplify HTML DOM Manipulation, Event Handling, Animations, and Ajax.

For more than 10 years, jQuery has been the most popular JavaScript library in the world.

However, after JavaScript Version 5 (2009), most of the jQuery utilities can be solved with a few lines of standard JavaScript:


Finding HTML Element by Id

Return the element with id="id01":

jQuery

myElement = $("#id01");
Try it now

JavaScript

myElement = document.getElementById("id01");
Try it now

Finding HTML Elements by Tag Name

Return all <p> elements:

jQuery

myElements = $("p");
Try it now

JavaScript

myElements = document.getElementsByTagName("p");
Try it now

Finding HTML Elements by Class Name

Return all elements with class="intro".

jQuery

myElements = $(".intro");
Try it now

JavaScript

myElements = document.getElementsByClassName("intro");

Try it now

Finding HTML Elements by CSS Selectors

Return a list of all <p> elements with class="intro".

jQuery

myElements = $("p.intro");
Try it now

JavaScript

myElements = document.querySelectorAll("p.intro");
Try it now



Practice Excercise Practice now

JavaScript / JQuery HTML Elements

jQuery vs JavaScript

jQuery was created in 2006 by John Resig. It was designed to handle Browser Incompatibilities and to simplify HTML DOM Manipulation, Event Handling, Animations, and Ajax.

For more than 10 years, jQuery has been the most popular JavaScript library in the world.

However, after JavaScript Version 5 (2009), most of the jQuery utilities can be solved with a few lines of standard JavaScript:


Set Text Content

Set the inner text of an HTML element:

jQuery

myElement.text("Hello Sweden!");
Try it now

JavaScript

myElement.textContent = "Hello Sweden!";
Try it now

Get Text Content

Get the inner text of an HTML element:

jQuery

myText = $("#02").text();
Try it now

JavaScript

myText = document.getElementById("02").textContent;
Try it now

Set HTML Content

Set the HTML content of an element:

jQuery

myElement.html("<p>Hello World</p>");
Try it now

JavaScript

myElement.innerHTML = "<p>Hello World</p>";
Try it now

Get HTML Content

Get the HTML content of an element:

jQuery

content = myElement.html();
Try it now

JavaScript

content = myElement.innerHTML;
Try it now



Practice Excercise Practice now

JavaScript / JQuery CSS Styles

jQuery vs JavaScript

jQuery was created in 2006 by John Resig. It was designed to handle Browser Incompatibilities and to simplify HTML DOM Manipulation, Event Handling, Animations, and Ajax.

For more than 10 years, jQuery has been the most popular JavaScript library in the world.

However, after JavaScript Version 5 (2009), most of the jQuery utilities can be solved with a few lines of standard JavaScript:


Hiding HTML Elements

Hide an HTML Element:

jQuery

myElement.hide();
Try it now

JavaScript

myElement.style.display = "none";
Try it now

Showing HTML Elements

Show an HTML Element:

jQuery

myElement.show();
Try it now

JavaScript

myElement.style.display = "";

Try it now

Styling HTML Elements

Change the font size of an HTML element:

jQuery

$("#demo").css("font-size","35px");
Try it now

JavaScript

document.getElementById("demo").style.fontSize = "35px";
Try it now



Practice Excercise Practice now

JavaScript / JQuery HTML DOM

jQuery vs JavaScript

jQuery was created in 2006 by John Resig. It was designed to handle Browser Incompatibilities and to simplify HTML DOM Manipulation, Event Handling, Animations, and Ajax.

For more than 10 years, jQuery has been the most popular JavaScript library in the world.

However, after JavaScript Version 5 (2009), most of the jQuery utilities can be solved with a few lines of standard JavaScript:


Removing HTML Elements

Remove an HTML element:

jQuery

$("#id02").remove();
Try it now

JavaScript

document.getElementById("id02").remove();
Try it now

Get Parent Element

Return the parent of an HTML element:

jQuery

myParent = $("#02").parent.prop("nodeName");
Try it now

JavaScript

myParent = document.getElementById("02").parentNode.nodeName;
Try it now



Practice Excercise Practice now

Previous Next
COMPANY
  • About us
  • Careers
  • Contact Us
  • In Press
  • People
  • Companies List
Products
  • Features
  • Coding Assessments
  • Psychometric Assessment
  • Aptitude Assessments
  • Tech/Functional Assessments
  • Video Assessment
  • Fluency Assessment
  • Campus
 
  • Learning
  • Campus Recruitment
  • Lateral Recruitment
  • Enterprise
  • Education
  • K 12
  • Government
OTHERS
  • Blog
  • Terms of Services
  • Privacy Policy
  • Refund Policy
  • Mart Category
Partner
  • Partner Login
  • Partner Signup

Copyright © RVR Innovations LLP 2025 | All rights reserved - Mytat.co is the venture of RVR Innovations LLP