We can use :first-child Selector in jQuery to apply style on the fly. It selects all first-child of the element specified..
The :first-child selector matches more than one elements for each parent. This method is equivalent to the method :nth-child(1).
This is how we can apply the style to the first elements of each parent using jQuery.
Credit: jQuery Docs
child examples first-child nth-child style