In this article we will talk All about jQuery, its uses, jQuery selectors, its benefits, prior knowledge to get started with jQuery and editors to write jQuery code.
1. What is jQuery
jQuery is a Lightweight JavaScript library in which you actually write JavaScript code but its code size will be too smaller than that of JavaScript code. The reason behind why jQuery was developed is while writing
- Long Selectors
- Complex Animations
- Lengthy DOM Manipulation
- Lengthy Ajax Code
In JavaScript becomes too complex to write and understand, so jQuery team develop many types of functions for these and add them to file and named it jQuery. For example, writing an Ajax code in JavaScript will be of ten lines while in jQuery it will be one line of code. That is why, the motto of jQuery team is
Write less, do more
2. Why use jQuery
The reasons why learning jQuery are
- Short Selectors in jQuery
- Variety of animation functions in jQuery
- Easy DOM manipulation in jQuery
- Easy DOM traversing in jQuery
- Simple and Short code of Ajax in jQuery
3. Selectors example in jQuery
As we told you about jQuery, it has much easier selectors to target HTML Classes, Id's and Tags using the following short code
1. Target Classes in jQuery
$('.classname')
It will target the class name which is present in the html file.
2. Target Id's in jQuery
$('#idname')
It will target the Id name which is present in the html file.
3. Target Tag in jQuery
$('tagname')
It will target the tag name which is present in the html file.
4. Benefits of using jQuery
1. Browser Independent
Browser Independent? You will be thinking that what means about Browser Independent, so it means that you can run jQuery code in any browser like Chrome, Firefox, Mozilla, Safari, etc.
2. Increases your coding Speed
jQuery increases your coding speed because you will be using short functions, selectors, etc. to make your web pages.
5. What languages to learn before learning jQuery
Before learning jQuery you should have a basic knowledge of
- Html
- CSS
- JavaScript (Basics) or (Advance)
I have seen many people that you can learn jQuery without having the knowledge of JavaScript, it is totally a 100% wrong myth and you have to learn JavaScript (basics) to get started with jQuery.6. Code Editors for jQuery Coding
For jQuery coding we have the following Code Editors
- Notepad
- Notepad++
- Visual Studio Code (Recommended)
- Sublime Text
- Atom
7. How much time does it takes to learn jQuery
It will take around 1 - 2 weeks to learn jQuery basics and it takes around 2 - 3 weeks to learn jQuery advance because there are too much things to learn in jQuery like DOM traversing, CSS styling, etc.
Conclusion
At the end, I would like to say that jQuery is one of the best library of JavaScript for building interactive web apps or you can say websites.
_____________________________________________________________________________________