Child Selector (“parent > child”) in jQuery

It helps to select all elements that are a direct child of the specified element.

Child Selector (“parent > child”)

// To select all < span> elements that are a direct child of a < div> element and change it background color to yellow.

$(“div > span”).css(“background-color”,”yellow”);