jQuery addClass Method

Read the tutorial on YogiHosting »

1. Add a Single Class Name

My Paragraph

2. Add 3 Class Names

My Paragraph

3. Using jQuery addClass Function Parameter

Add "borderSolid" class to the paragraph whose index is not 0 and does not contain "red" class.

First Paragraph with class "Red"

Second Paragraph with class "Red"

Third Paragraph without any class