How to apply CSS in even childs of parent node using jQuery ?
In this article, we will see how to set styles in even child of parent element using jQuery. To set the style on even child of the parent, we use jQuery :nth-child(even) selector.
The :nth-child(even) selector is used to select every element that is the even child of its parent element.
Approach: First, we create an HTML element containing a div element. This div element contains some paragraph element, then we use :nth-child() selector to select all even position child of the parent element.