Has Attribute Jquery. Using jquery's.attr() method to get the value of an element's attribute has two main benefits: Use jquery hasattribute () method to see if there is an attribute for an element.
Using jquery’s.attr() method to get the value of an element’s attribute has two main benefits: .addclass () adds the specified.