1) Manipulating DOM elements
2) Creating #HTML on the fly
3) Binding events and triggering them using code
4) Sending ajax requests to the server.
There are two ways in which jQuery can be started on website:
1) Downloading the jQuery library from jQuery.com
2) Including jQuery from a CDN.
Selectors: jQuery selectors are the most essential in jQuery. They are used to find elements on the basis of their id, class, tagname etc. All the selectors start with a dollar sign. Given below are a few selectors:
1) The #id selector: It uses the id attribute to select an HTML element. eg., $("#id")
2) The.class selector: It finds the element with a specified CSS class. eg., $(".class")
3) The tag selector: It finds all the elements having a specified tag eg., $("a") finds all anchor tags.
Functions: There are several functions or API's which provide exciting features. A few of them are as follows:
1) hide() - hides an element
2) show() - shows an element
3) HTML() - sets the HTML of an element
4) append() - appends HTML at the end of an element
5) prepend() - inserts HTML at the beginning of an element
Event Binding and triggering: jQuery can be used to bind events to HTML elements and also to trigger those events.
A click event can be bound to a button using $("button").bind("click",handler) where "handler" is a function that needs to be invoked on the click of the respective button. The click event can be triggered using the following code snippet: $("button").trigger("click").
Ajax Requests: Ajax requests can be sent using #jQuery which would perform a POST or GET request to the server and in turn fetch data from the server.
Plugins: The #jQuery # community also has several #plugins that works as a reusable component that can be used on websites. Few of those are:
1) UI dialog