Какие значения и кому надо назначить, как выбирать конкретное значение в зависимости от индекса элемента:
const key = 'background-color';
const values = [ 'red', 'lime', 'yellow', 'aqua', 'brown', 'magenta' ];
const getValue = i => values[i % values.length];
const selector = '.item';
Назначаем:
$(selector).css(key, getValue);
// или
document.querySelectorAll(selector).forEach((n, i) => {
n.style[key] = getValue(i);
// или
n.style.setProperty(key, getValue(i));
// или
n.style.cssText += `${key}: ${getValue(i)}`;
// или
n.setAttribute('style', key + ': ' + getValue(i));
});