addClass() in jQuery
This method is used to add one or more class names to the specified element.
Syntax 1
$(selector).addClass(className)
- className - Name of one or more space-separated classes to be added.
Syntax 2
$(selector).addClass(function(index,currentClass))
- index - index position of the element in the set.
- currentClass - Existing class name(s)