In this post, we will learn some basic usage of jQuery in web development.
In modern development, jQuery has become an essential thing.
It makes our developing work faster and it is also easy to learn.
So Let’s Start.
What Is jQuery?
It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multiple browsers.
Benefits of using jQuery:
- Using jQuery you can Handle events like Click, hover, change, keyup, etc… and perform some action on it.
- jQuery allows you to make add animation to your page like fade in, fade out, slide in, slide out or you can make custom animation.
- With jQuery you can also make Ajax request without refreshing your whole page.
And lot more…..
- 12 Most Helpful jQuery Methods and Functions
- 8 Most useful Jquery Selectors - You Need To Know
- How to check-uncheck all checkbox With jQuery
Create an HTML page with its basic structure as follow:
<!DOCTYPE html> <html> <head> <title>jQuery Step-by-step</title> </head> <body> <!-- Content Area--> </body> </html>
Add the element to perform some action on it.we’re going to add two links for enabling and disabling and one button.Add the following code inside the Body tag:
<a href="#" id="next">Disable</a> <button>Register</button> <a href="#" id="prev">Enable</a>
Now we are going to add Jquery Libray.
You can add Jquery by Downloading From official site Jquery.com.
But in This example we are going to use Google’s copy of Jquery.
Add The Following Code Below the Body tag:
Add jQuery Script Below it.
In following code we are using link id ‘next’ and ‘prev’ to perform task.
Complete Code: Here is the Complete code achieve from the above steps.
So, These are some basic uses of Jquery. Thanks for reading.
Do let me know If you face any difficulties please feel free to comment below we love to help you. if you have any feedback suggestions then please inform us by commenting.