:focus selector

Selects element if it is currently focused. As with other pseudo-class selectors (those that begin with a ":"), it is recommended to precede :focus with a tag name or some other selector; otherwise, the universal selector ( "*" ) is implied. In other words, the bare $( ":focus" ) is equivalent to $( "*:focus" ). If you are looking for the currently focused element, $( document.activeElement ) will retrieve it without having to search the whole DOM tre

.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

: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

:first-of-type selector

Selects all elements that are the first among siblings of the same element name. The :first-of-type selector matches elements that have no other element with both the same parent and the same element name coming before it in the document tree. jQuery( ":first-of-type" ) version added: 1.9 Examples:

.first()

Reduce the set of matched elements to the first in the set. Given a jQuery object that represents a set of DOM elements, the .first() method constructs a new jQuery object from the first element in that set. Consider a page with a simple list on it: <ul> <li>list item 1</li> <li>list item 2</li> <li>list item 3</li> <li>list item 4</li> <li>list item 5</li> </ul> We can

.has()

Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. Given a jQuery object that represents a set of DOM elements, the .has() method constructs a new jQuery object from a subset of the matching elements. The supplied selector is tested against the descendants of the matching elements; the element will be included in the result if any of its descendant elements matches the selector. Consider a page

.focusin()

Bind an event handler to the "focusin" event. This method is a shortcut for .on( "focusin", handler ) in the first two variations, and .trigger( "focusin" ) in the third. The focusin event is sent to an element when it, or any element inside of it, gains focus. This is distinct from the focus event in that it supports detecting the focus event on parent elements (in other words, it supports event bubbling). This event will likely be used together with

.focus()

Bind an event handler to the "focus" JavaScript event, or trigger that event on an element. This method is a shortcut for .on( "focus", handler ) in the first and second variations, and .trigger( "focus" ) in the third. The focus event is sent to an element when it gains focus. This event is implicitly applicable to a limited set of elements, such as form elements (<input>, <select>, etc.) and links (<a href>). In recent browser vers

.finish()

Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements. When .finish() is called on an element, the currently-running animation and all queued animations (if any) immediately stop and their CSS properties set to their target values. All queued animations are removed. If the first argument is provided, only the animations in the queue represented by that string will be stopped. The .fini

event.which

For key or mouse events, this property indicates the specific key or button that was pressed. The event.which property normalizes event.keyCode and event.charCode. It is recommended to watch event.which for keyboard key input. For more detail, read about event.charCode on the MDN. event.which also normalizes button presses (mousedown and mouseupevents), reporting 1 for left button, 2 for middle, and 3 for right. Use event.which instead of event.butto