

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the difference between jQuery and JavaScript?
The following is the difference between jQuery and JavaScript:
jQuery
jQuery is a fast and concise JavaScript library created by John Resig in 2006. jQuery simplifies HTML document traversing, event handling, animating, and Ajax interactions for Rapid Web Development.
JavaScript
JavaScript is a lightweight, interpreted programming language. It is designed for creating network-centric applications. It is complimentary to and integrated with Java. JavaScript is very easy to implement because it is integrated with HTML. It is open and cross-platform.
jQuery is automatically optimized to work with a lot of browsers. But, JavaScript is still dealing with some issues such as cross-browser compatibility. This can be due to poor JavaScript implementation practices by web browser developers.
jQuery needs less testing of code, and lesser code for the same goal, when compared with JavaScript. For example, to change font-size, background color, etc.
Let us see an example of jQuery and JavaScript to change the background color:
JavaScript
function changeColor(color) { document.body.style.background = color; } Onload=”changeColor('blue’);”
jQuery
$ (‘body’) .css (‘background’, ‘#0000FF’);
As shown above, both the code snippets are doing the same work of changing the background color. But jQuery takes less code and in this way you can work around other examples also, which shows that jQuery minimizes the code and is easier to use.
- Related Questions & Answers
- What is the difference between jQuery and AngularJS?
- What is the difference between jQuery(selector) and $(selector)?
- What is the difference between Ajax and jQuery-Ajax methods in jQuery?
- What is the difference between filter() and find() in jQuery?
- What is the difference between text() and html() in jQuery?
- What is the difference between Grep and Filter in jQuery?
- What is the difference between jQuery.children( ) and jQuery.siblings( ) in jQuery?
- What is the difference between event.preventDefault() and event.stopPropagation() in jQuery?
- What is the difference between append() and appendTo() in jQuery?
- What is the difference between height and innerHeight in jQuery?
- What is the difference between height and outerHeight in jQuery?
- What is the difference between innerHeight and outerHeight in jQuery?
- What is the difference between width and innerWidth in jQuery?
- What is the difference between width and outerWidth in jQuery?
- What is the difference between jQuery.offsetParent( ) and jQuery.offset( ) in jQuery?