JSFiddle - React, Tailwind, and code Playground

HTML

<div>div 1</div>
<div>div 2</div>
<div>div 3</div>
<div>div 4</div>

JavaScript

$(document).ready(function(){
    var i = 0;
    $('div').each(function(){
        i++;
        if(i == 2){
            return;
        }
        $(this).css('color', 'red');
    })
});