In this article, we will see how to find all children of each division element of HTML document.
- .children(): This method returns all direct children of the selected element.
- .css(): This method is used to set or return one or more style properties for the selected elements.
- Create the HTML page with various div elements with their children.
- Using the .children() method, find the children of division element.
- Using the .css() method, style those children element of division element.
Output: In this example, first we have found all children of div element and applied background property of CSS. All the children of the division element should be highlighted on the webpage.