What is jQuery?
As same as open-source software, jQuery acts as the JS library that simplifies the HTML client-side scripting. jQuery synthesizes all problems in JS into a library.
The main purpose of jQuery is to provide an easy way to use JavaScript on your website to make it more interactive and attractive. It is also used to add animation..
Why jQuery?
jQuery is a lightweight, "write less, do more"
, JavaScript library. jQuery takes a lot of common tasks that require many lines of JavaScript code to accomplish,
and wraps them into methods that you can call with a single line of code. jQuery also simplifies a lot of the complicated things from JavaScript, like AJAX calls and DOM manipulation etc.
Is jQuery is a Programming Language?
jQuery is not a programming language but a well-written JavaScript code. It is used to traverse documents, event handling, Ajax interaction, and Animation.
Why do we use jQuery?
What is $() in jQuery library?
The $() function is an alias of jQuery
function. It is used to wrap any object into jQuery object which later facilitates
you to call the various method defined jQuery object. You can pass a selector string to $() function,
and it returns a jQuery object which contains an array of all matched DOM elements.
How to use jQuery?
We can use jquery by using two methods:
Examples# By Using jQuery File Local Machine
<html> <head> <title>The jQuery Example</title> <script type = "text/javascript" src = "/jquery/jquery-2.1.3.min.js"> </script> <script type = "text/javascript"> $(document).ready(function() { document.write("Hello, DotNet Palace!"); }); </script> </head> <body> <h1>Hello DotNet Palace</h1> </body> </html>
Examples# By Using jQuery File From CDN
<html> <head> <title>The jQuery Example</title> <script type = "text/javascript" src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"> </script> <script type = "text/javascript"> $(document).ready(function() { document.write("Hello, DotNet Palace!"); }); </script> </head> <body> <h1>Hello DotNet Palace</h1> </body> </html>
Summary
To summarise, jQuery is a fast, lightweight, feature-rich client-side which uses JavaScript library. Hope you picked up a thing or two.
Cheers!