try
$("ul li:nth-child(3n+1)").addClass("A")
$("ul li:nth-child(3n+2)").addClass("B")
$("ul li:nth-child(3n)").addClass("C")
Feel free to consolidate it to make it prettier, but I wanted to expose the selectors.
More Related Contents:
- CSS Trouble adding border
- Why is my jQuery :not() selector not working in CSS?
- Wrap every 3 divs in a div
- Select deepest child in jQuery
- jQuery or CSS selector to select all IDs that start with some string [duplicate]
- Selecting empty text input using jQuery
- How to select all content between two tags in jQuery
- CSS selector case insensitive for attributes
- jQuery: Selecting all elements where attribute is greater than a value
- What CSS3 selectors does jQuery really support, e.g. :nth-last-child()?
- jQuery: select an element’s class and id at the same time?
- jQuery :contains selector to search for multiple strings
- Selecting only first-level elements in jquery
- How to select an element that has focus on it with jQuery
- jquery nth child that is currently visible
- How do you select elements based on their style?
- :nth-of-type() in jQuery / Sizzle?
- Difference between CSS selector and jQuery filter?
- How to select all elements with a particular ID in jQuery?
- Determining whether jQuery has not found any element
- Select last 5 elements with jQuery
- What JQuery selector excludes items with a parent that matches a given selector?
- Performance differences between using “:not” and “.not()” selectors?
- How to select first row of the first table in an html page using jQuery?
- How to position one element relative to another with jQuery?
- Using JQuery Validate Plugin to validate multiple form fields with identical names
- $(document).on(‘click’, ‘#id’, function() {}) vs $(‘#id’).on(‘click’, function(){}) [closed]
- Jquery dialog partial view server side validation on Save button click
- Setting the selected attribute on a select list using jQuery
- How to remove css property in jQuery