Jquery selector has attribute This selector targets elements that have the specified attribute. For example, to select all elements with a title attribute, you would use $(“[title]”). hasAttributes = function( objNode, intStackIndex, Description: Selects elements that have the specified attribute with a value beginning exactly with a given string. It will select an element if the selector's string appears anywhere within the element's attribute value. At the end of this article, you will understand everything about the jQuery Attribute selector. button'), now this can have an attribute 'xyz'. attr(attribute, value)To set attribute and value using a function:$(selector). attr(attribute)To set the attribute and value:$(selector). – JoseMarmolejos. value: An attribute value.