How to apply CSS in even childs of parent node using jQuery ? Last Updated : 05 Jun, 2023 Comments Improve Suggest changes Like Article Like Report In this article, we will see how to set styles in even the child of the parent element using jQuery. To set the style on the 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. Syntax: $("Selector:nth-child(even)") 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. Example: In this example, we will apply CSS in even the child of the parent node by using jQuery. HTML <!DOCTYPE html> <html> <head> <script src= "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"> </script> <style> div { font-size: 18px; font-weight: bold; } p { margin-left: 50px; } </style> <script> $(document).ready(function () { $("p:nth-child(even)").css({ backgroundColor: "green", color: "white", padding: "5px 15px", display: "table" }); }); </script> </head> <body> <h1 style="color: green;">GeeksforGeeks</h1> <h3> How to apply CSS in even childs of parent node using jQuery library? </h3> <div> <p>Data Structure</p> <p>C++ Programming</p> <p>javaScript</p> <p>Web Technology</p> </div> </body> </html> Oof parentsutput: Comment More infoAdvertise with us Next Article How to apply CSS in even childs of parent node using jQuery ? V vkash8574 Follow Improve Article Tags : Web Technologies JQuery jQuery-Questions Similar Reads How to apply CSS in odd childs of parent node using jQuery ? In this article, we will see how to set styles in the odd child of the parent element using jQuery. To set the style on the odd child of the parent, we use jQuery :nth-child(odd) selector. The :nth-child(odd) selector is used to select every element that is the odd child of its parent element. Synta 1 min read How to apply CSS in last child of parent using jQuery ? In this article, we will see how to set styles in the last child of the parent element using jQuery. To set the style on the last child of parent, we use jQuery :last-child selector. The :last-child selector is used to select every element that is the last child of its parent element. Syntax: $("Sel 1 min read How to apply css property to a child element using JQuery? The task is to apply CSS property to a child element using jQuery. To do that, first we select the child element with the help of children() method in jQuery and then apply CSS property to it with the help of css() method in jQuery. Syntax: // Note : children method selects the direct child to paren 2 min read How to apply CSS in a particular div element using jQuery ? In this article, we will set the CSS of a div element using jQuery. We will use the CSS property to set the CSS.Approach: We will create a div element with some text and hyperlinks. Then we will use jQuery to apply CSS to the div element. jQuery comes with the function .css() where we can get and se 2 min read How to remove all CSS classes using jQuery ? In this article, we will remove all CSS classes for an element using jQuery. To remove all CSS classes of an element, we use removeClass() method. The removeClass() method is used to remove one or more class names from the selected element. Syntax: $(selector).removeClass(class_name, function(index, 2 min read Like