jQuery and jQuery UI > jQuery Selectors > jQuery Attribute Selectors |
If you’d like to select an element by attribute rather than by HTML elements, you can use Xpath expressions to select elements with a specific attribute. For example:
$(“[href]”)
selects all elements with an href attribute.$(“[href=”#”]”)
selects all elements with an href attribute with a value equal to “#”.$(“[href!=”#”]”)
selects all elements with an href attribute with a value that is not equal to “#”.