jQuery Examples

Last Updated : 24 Jul, 2025

The following jQuery section contains a wide collection of jQuery examples. The examples are categorized based on the topics including Selectors, Event methods, Plugins, and many more. Each program example contains multiple approaches to solve the problem.

Prerequisite: jQuery Tutorial

Selectors Questions

1How to get a DOM Element from a jQuery Selector?
2Not class selector in jQuery
3How to use JavaScript variables in jQuery selectors ?
4How to validate input field while focusout?
5How to store data in the DOM?
6How to find all checkbox inputs using jQuery?
7How to find all input elements that are enabled using jQuery?
8How to loop through input elements in jQuery?
9How to remove all paragraphs from the DOM using jQuery?
10How to get the width and height of an element in jQuery?
11How to use jQuery to Search and Replace HTML elements?
12How to detect and change the content/style of a div using jQuery?
13How to select all on focus in input using JQuery?
14How to check a selector matches some content using jQuery?
15How to change the color of any div that is animated using jQuery?
16How to find all inputs that are descendants of a form and mark them with a dotted red border in jQuery?
17How to find all links with an hreflang attribute using jQuery?
18How to select direct parent element of an element in jQuery?
19How to find all button inputs and mark them using jQuery?
20How to find inputs with an attribute name starting with specific letter or text using jQuery?

Event based Questions

1How to check whether the event namespace is used in jQuery?
2How to set different color for each letter in a text field using jQuery?
3How to change an element color based on value of the color picker value on click?
4Trigger a keypress/keydown/keyup event in JS/jQuery

HTML/CSS Method based Questions

1How to reset/remove CSS styles for element?
2Most efficient way to create HTML elements using jQuery
3How to find all inputs that are descendants of a form and mark them with a dotted red border in jQuery ?
4Get the numeric part of CSS property using jQuery
5How to find all checkbox inputs using jQuery ?
6How to find all input elements that are enabled using jQuery?
7How to smoothly transition CSS background images using jQuery?
8How to create HTML elements using jQuery in an efficient way?
9How to set CSS style to half of a character?
10How to get the input file size in jQuery?
11How to hide div element after few seconds in jQuery?
12How to find the parent class name with known class in jQuery?
13How to get the numeric part of CSS property using jQuery?

AJAX Questions

1How to demonstrate the use of Ajax loading data in DataTables ?
2How to pass multiple JSON Objects as data using jQuery’s $.ajax() ?
3How to get request using AJAX by making Custom HTTP library?
4How to use simple API using AJAX ?
5How to do asynchronous file transfer in AJAX?

Plugins Based Questions

1How to check if a jQuery plugin is loaded?
2How to integrate jQuery Pagination Plugin?
3How to create a news ticker using jQuery?
4How to use API inside callbacks using jQuery DataTables plugin?
5How to handle events using jQuery DataTables plugin?
6How to load data from JavaScript array using jQuery DataTables plugin?
7How to initialize multiple tables using jQuery DataTables plugin?
8How to implement column specific search filter using DataTables plugin?
9How to make your own countUp.js plugin using JavaScript?
10How to handle DataTable specific events using jQuery DataTable plugin?
11How to handle nested data objects using jQuery DataTables plugin?
12How to design calendar for web page using jQuery EasyUI?
13How to design buttons for mobiles using jQuery EasyUI Mobile?
14How to make table searchable and sortable with pagination using jQuery?
15