.resize()

Bind an event handler to the "resize" JavaScript event, or trigger that event on an element. This method is a shortcut for .on('resize', handler) in the first and second variations, and .trigger( "resize" ) in the third. The resize event is sent to the window element when the size of the browser window changes: $( window ).resize(function() { $( "#log" ).append( "<div>Handler for .resize() called.</div>" ); }); Now whenever the browser w

.prevUntil()

Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. Given a selector expression that represents a set of DOM elements, the .prevUntil() method searches through the predecessors of these elements in the DOM tree, stopping when it reaches an element matched by the method's argument. The new jQuery object that is returned contains all previous siblings up to but not including

.ready()

Specify a function to execute when the DOM is fully loaded. While JavaScript provides the load event for executing code when a page is rendered, this event does not get triggered until all assets such as images have been completely received. In most cases, the script can be run as soon as the DOM hierarchy has been fully constructed. The handler passed to .ready() is guaranteed to be executed after the DOM is ready, so this is usually the best place t

:radio selector

Selects all elements of type radio. $( ":radio" ) is equivalent to $( "[type=radio]" ). As with other pseudo-class selectors (those that begin with a ":") it is recommended to precede it with a tag name or some other selector; otherwise, the universal selector ("*") is implied. In other words, the bare $( ":radio" ) is equivalent to $( "*:radio" ), so $( "input:radio" ) should be used instead. To select a set of associated radio buttons, you might us

.pushStack()

Add a collection of DOM elements onto the jQuery stack. .pushStack( elements ) version added: 1.0 elements Array An array of elements to push onto the stack and make into a new jQuery object. .pushStack( elements, name,

.promise()

Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished. The .promise() method returns a dynamically generated Promise that is resolved once all actions of a certain type bound to the collection, queued or not, have ended. By default, type is "fx", which means the returned Promise is resolved when all animations of the selected elements have completed. Resolve context and sole argum

.replaceAll()

Replace each target element with the set of matched elements. The .replaceAll() method is similar to .replaceWith(), but with the source and target reversed. Consider this DOM structure: <div class="container"> <div class="inner first">Hello</div> <div class="inner second">And</div> <div class="inner third">Goodbye</div> </div> We can create an element, then replace other elements with it: $( "<

.prev()

Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector. Given a jQuery object that represents a set of DOM elements, the .prev() method searches for the predecessor of each of these elements in the DOM tree and constructs a new jQuery object from the matching elements. The method optionally accepts a selector expression of the same type that can be passed to the $() function. If the sele

.prevAll()

Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector. Given a jQuery object that represents a set of DOM elements, the .prevAll() method searches through the predecessors of these elements in the DOM tree and construct a new jQuery object from the matching elements; the elements are returned in order beginning with the closest sibling. The method optionally accepts a selector expression of the sa

.remove()

Remove the set of matched elements from the DOM. Similar to .empty(), the .remove() method takes elements out of the DOM. Use .remove() when you want to remove the element itself, as well as everything inside it. In addition to the elements themselves, all bound events and jQuery data associated with the elements are removed. To remove the elements without removing data and events, use .detach() instead. Consider the following HTML: <div class="con