.index()

Search for a given element from among the matched elements. Return Values If no argument is passed to the .index() method, the return value is an integer indicating the position of the first element within the jQuery object relative to its sibling elements. If .index() is called on a collection of elements and a DOM element or jQuery object is passed in, .index() returns an integer indicating the position of the passed element relative to the original

.focusout()

Bind an event handler to the "focusout" JavaScript event. This method is a shortcut for .on( "focusout", handler ) when passed arguments, and .trigger( "focusout" ) when no arguments are passed. The focusout event is sent to an element when it, or any element inside of it, loses focus. This is distinct from the blur event in that it supports detecting the loss of focus on descendant elements (in other words, it supports event bubbling). This event wil

.hasClass()

Determine whether any of the matched elements are assigned the given class. Elements may have more than one class assigned to them. In HTML, this is represented by separating the class names with a space: <div id="mydiv" class="foo bar"></div> The .hasClass() method will return true if the class is assigned to an element, even if other classes also are. For example, given the HTML above, the following will return true: $( "#mydiv" ).hasCla

:header selector

Selects all elements that are headers, like h1, h2, h3 and so on. Because :header is a jQuery extension and not part of the CSS specification, queries using :header cannot take advantage of the performance boost provided by the native DOM querySelectorAll() method. To achieve the best performance when using :header to select elements, first select the elements using a pure CSS selector, then use .filter(":header"). jQuery( ":header"

.html()

Get the HTML contents of the first element in the set of matched elements. This method is not available on XML documents. In an HTML document, .html() can be used to get the contents of any element. If the selector expression matches more than one element, only the first match will have its HTML content returned. Consider this code: $( "div.demo-container" ).html(); In order for the following <div>'s content to be retrieved, it would have to be

:has() selector

Selects elements which contain at least one element that matches the specified selector. The expression $( "div:has(p)" ) matches a <div> if a <p> exists anywhere among its descendants, not just as a direct child. Because :has() is a jQuery extension and not part of the CSS specification, queries using :has() cannot take advantage of the performance boost provided by the native DOM querySelectorAll() method. For better performance in mode

Has attribute selector [name]

Selects elements that have the specified attribute, with any value. jQuery( "[attribute]" ) version added: 1.0 Examples: Bind a single click to divs with an id that adds the id to the div's text. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"&g

.get()

Retrieve one of the elements matched by the jQuery object. The .get() method grants access to the DOM nodes underlying each jQuery object. If the value of index is out of bounds â less than the negative number of elements or equal to or greater than the number of elements â it returns undefined. Consider a simple unordered list: <ul> <li id="foo">foo</li> <li id="bar">bar</li> </ul> With an index specified, .get

:first selector

Selects the first matched element. The :first pseudo-class is equivalent to :eq( 0 ). It could also be written as :lt( 1 ). While this matches only a single element, :first-child can match more than one: One for each parent. Because :first is a jQuery extension and not part of the CSS specification, queries using :first cannot take advantage of the performance boost provided by the native DOM querySelectorAll() method. To achieve the best performance

.height()

Get the current computed height for the first element in the set of matched elements. The difference between .css( "height" ) and .height() 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 .height() method is recommended when an element's height needs to be used in a mathematical calculation. figure 1 This method is also able to find the height of the wi