.wrap()

Wrap an HTML structure around each element in the set of matched elements. The .wrap() function can take any string or object that could be passed to the $() factory function to specify a DOM structure. This structure may be nested several levels deep, but should contain only one inmost element. A copy of this structure will be wrapped around each of the elements in the set of matched elements. This method returns the original set of elements for chai

.unwrap()

Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. The .unwrap() method removes the element's parent. This is effectively the inverse of the .wrap() method. The matched elements (and their siblings, if any) replace their parents within the DOM structure. .unwrap() version added: 1.4

.triggerHandler()

Execute all handlers attached to an element for an event. .triggerHandler( eventType ) executes all handlers bound with jQuery for the event type. It will also execute any method called on{eventType}() found on the element. The behavior of this method is similar to .trigger(), with the following exceptions: The .triggerHandler( "event" ) method will not call .event() on the element it is triggered on. This means .triggerHandler( "submit" ) on a form w

.unload()

Bind an event handler to the "unload" JavaScript event. This method is a shortcut for .on( "unload", handler ). The unload event is sent to the window element when the user navigates away from the page. This could mean one of many things. The user could have clicked on a link to leave the page, or typed in a new URL in the address bar. The forward and back buttons will trigger the event. Closing the browser window will cause the event to be triggered.

.width()

Get the current computed width for the first element in the set of matched elements. The difference between .css(width) and .width() is that the latter returns a unit-less pixel value (for example, 400) while the former returns a value with units intact (for example, 400px). The .width() method is recommended when an element's width needs to be used in a mathematical calculation. figure 1 This method is also able to find the width of the window and d

.val()

Get the current value of the first element in the set of matched elements. The .val() method is primarily used to get the values of form elements such as input, select and textarea. In the case of select elements, it returns null when no option is selected and an array containing the value of each selected option when there is at least one and it is possible to select more because the multiple attribute is present. For selects and checkboxes, you can

.toggleClass()

Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the state argument. This method takes one or more class names as its parameter. In the first version, if an element in the matched set of elements already has the class, then it is removed; if an element does not have the class, then it is added. For example, we can apply .toggleClass() to a simple <div>:

.trigger()

Execute all handlers and behaviors attached to the matched elements for the given event type. Any event handlers attached with .on() or one of its shortcut methods are triggered when the corresponding event occurs. They can be fired manually, however, with the .trigger() method. A call to .trigger() executes the handlers in the same order they would be if the event were triggered naturally by the user: $( "#foo" ).on( "click", function() { alert( $(

.toArray()

Retrieve all the elements contained in the jQuery set, as an array. .toArray() returns all of the elements in the jQuery set: alert( $( "li" ).toArray() ); All of the matched DOM nodes are returned by this call, contained in a standard array: [<li id="foo">, <li id="bar">] .toArray() version added: 1.4 This me

:text selector

Selects all input elements of type text. $( ":text" ) allows us to select all <input type="text"> elements. 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 $( ":text" ) is equivalent to $( "*:text" ), so $( "input:text" ) should be used instead. Note: As of jQuery 1.5.2, :text