Practical solutions

jQuery Howtos How-To Guides

Solve the problem. Keep building. Collection of jQuery how-to articles

Find the answer you need

Browse practical solutions, grouped by the task you're working on.

__COUNT__ entries on this page

How to Create Elements in jQueryThis tutorial demonstrates how to create an HTML element in jQuery. How to Create an Alert Using jQueryThis article demonstrates how to create an alert using jQuery. How to Use the NPM jQuery ModuleThis tutorial demonstrates how to install and use the npm jQuery module. How to Use the for Loop in jQueryThis tutorial demonstrates how to use the for loop in jQuery. How to Scroll to Element in jQueryWe use scrollTop() and offset() functions to scroll to element in this post. We show different ways and useful options for every use case. Also, we provide two shortcuts and few tips you need to take care of. You will also learn to animate scroll in jQuery. How to Replace Text and DOM Elements in jQueryThis tutorial demonstrates how to replace the text and DOM elements in jQuery. How to Display a Tooltip Message on Hover Using jQueryThis tutorial demonstrates how to use the Tooltip in jQuery-UI to display a tooltip message on hover using jQuery. How to Remove Class in jQueryThis tutorial demonstrates how to remove class names in jQuery. How to Check if an Element Exists Using jQueryThis tutorial demonstrates how to check if an element exists using jQuery. jQuery Confirm PluginThe jQuery confirm is a plug-in that ensures multipurpose facilities including the functions of alert, dialog, and confirm. Also, it allows updated UI, themes, and many more conventions. How to Get Height in jQueryIn today's post, we'll learn about getheight method in jQuery. How to Trigger the Same Function From Multiple Events in jQueryThis article teaches you how to trigger the same function from multiple events in jQuery. We'll show two examples that show you how to do this using a jQuery API. The first example tracks user movements in HTML form inputs. While the second will change an HTML element background color. How to Submit Form With AJAX in jQueryThis article teaches you three methods that will submit a form using AJAX-in-jQuery. The first is direct use of AJAX-in-jQuery while the second employs the AJAX Form Plugin. In the third method, we use the FormData object to grab the form data before sending it using AJAX. How to Set Value of Text Area in jQueryThis tutorial demonstrates the use of .val() and .attr() methods to set the value of text area in JQuery. How to Empty Input Field With JQueryThis tutorial demonstrates the use of .val() function to clear an input field in JQuery. How to Get Form Data Using JQueryThis article uses serialize() and serializeArray() method to get form data using JQuery. It also demonstrates how to get form data in an object form. How to Upload File AJAX in jQueryjQuery methods and conventions enhances the upload of files. In this regard, the AJAX (Asynchronous JavaScript And XML) will help to read data from a web server, update the webpage without reload, also post data to web server. How to Add ID to an HTML Element Using jQueryID uniquely represents an HTML element. To dynamically define the id for an element via jQuery, the .attr() method having the attribute id and value will work perfectly. But there can be another way to add an id to an element through jQuery: to use the .add() method. How to Change Background Color of an Element in jQueryThis article teaches you how to use jQuery to change the background color of an element on mouseover. We'll achieve this using two jQuery APIs which are queue() and hide(). How to Check jQuery Version in a User BrowserThis article teaches you how to get a jQuery version on a web page using two methods. The first method will check the version if the web page has loaded jQuery. While the second method checks the version if jQuery exists in the window object. How to Set and Delete a Cookie in jQueryThis article teaches you two examples that shows how to set and delete a cookie using jQuery. In the first example, you'll use a plugin called jquery-cookie that you can get from GitHub. The second example will use a custom function to create and delete the cookie. How to Remove an Event Listener in jQueryThis article teaches you five ways that show you how to remove an event listener in jQuery. Depending on how you added the event listener, you can implement any of the following methods. How to Create Multiselect Dropdown in jQueryThis article teaches you how to create a multiselect dropdown in jQuery. We'll do this using three libraries; Select2, Selectize.js, and jquery multiselect.js. These libraries have different implementations, but they'll help you create a multiselect dropdown. How to Remove a CSS Property Using jQueryThis article teaches you four methods that will remove a CSS property using jQuery. These methods will use four jQuery APIs which are css(), removeAttr(), removeClass(), and prop().