Home  >  jQuery

Example of Child Selector in jQuery

March 31, 2013
Child Selector in jQuery works like parent > child. Child Selector selects all the immediate child of the specified parent. On the selection, we can add CSS or can perform other functionality.
In the below example, we have ul>li relation. Here ul is parent and li is child.

<!DOCTYPE html>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<ul class="cls">
<script>$("ul.cls > li").css("border", "2px double green");</script>

  • A
  • B
    • X
    • Y
  • C

©2022 concretepage.com | Privacy Policy | Contact Us