id selector
Description: Selects a single element with the given id attribute.
-
version added: 1.0jQuery( "#id" )
id: An ID to search for, specified via the id attribute of an element.
For id selectors, jQuery uses the JavaScript function document.getElementById()
, which is extremely efficient. When another selector is attached to the id selector, such as h2#pageTitle
, jQuery performs an additional check before identifying the element as a