jquery add class to element with index





If you want to target the elements with multiple classes names, such as selecting the elementsjQuery Selecting Elements with Multiple Classes

Element with classA (wont match)

Javascript examples for jQuery Method and Property:addClass.Add the same css style for the first span element (index 0), as the existing p elements. To add a css class to the html element, addClass() method can be used.