Attribute Methods

setAttr Method:

The setAttr method sets attributes to any selected element(s). Attributes can be set in numerous ways. This method can take two arguments to set an attribute or just one.

main selector flags: all, odd, even, single, and, range

getAttr Method:

The getAttr method gets an attribute by its name and returns its value.

main selector flags: single

hasAttr Method:

The hasAttr method checks if an element has a particular attribute.

main selector flags: single

classList Method:

The classList method adds or removes a class name from an element's class list. This method takes two parameters. 

Parameters

param 1: This parameter is a case insensitive string value, too add a class it will accept "add" or "+" to remove a class it will accept "remove", "delete" or "-"

param 2: This parameter is a string value of the class name to apply to the selected element

hasClass Method:

The hasClass method checks to see if the selected element has the specified class in the element's class list.