“jQuery is an open source JavaScript library that simplifies the interaction between an HTML document, or more precisely the Document Object model and JavaScript.”jQuery makes Dynamic HTML (DHTML) and simplifies HTML document traversing and manipulation, DOM animation and cross-browser JavaScript development.This is the simple explanation of jQuery. Now let's learn why you should choose to learn jQuery.
These are some of the main reasons behind "Why jQuery?" as per the jQuery CookBook. We prefer jQuery because it works on a Write Less Do More Philosophy. Three concepts for this philosophy:
Implementation
Now let's implement the given three concepts.Find Element and do something with themAssume you want to hide a <div> element from the user. Load some new content into the hidden <div>, then change an attribute of the selected <div>, then make the hidden <div> visible again.The following is the code:So here in this code we are finding some elements and then doing something. Finding an element <div> from HTML using a (jQuery()) function and then did something with them, such as hid(), text(), addClass() and show().ChainingjQuery is constructed in a manner that will allow jQuery methods to be chained. Chaining can be understood by a rewrite of the previous code using a single JavaScript statement using chaining.This can be written like:And the third concept is Wrapped.jQuery wrapped setYou will be selecting DOM elements from an HTML page that will be wrapped with jQuery functionality. It is a "wrapped set" because it is a set of elements wrapped with jQuery functionality. Let's experiment with the previous code.Here jQuery will scan the page and place all <div> elements in the wrapper. So these are the three concepts of this philosophy. We will learn more in the next chapter. Thanks for today. Comment below if you have any query on today's session.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: