jQuery children() Method


Get all the elements of the selected element.


Syntax : jQuery Traversing – children() Method

$(selector).children([selector element]);

[selector element] String containing the selector expression for matching the elements.

jQuery Traversing – children() Example 1

jQuery children() Method with syntax

<script type="text/javascript">
         $(document).ready(function(){         
            $( "ul" ).children().css( "background","yellow" );        
          });
</script>

Try it »

jQuery Traversing – children() Example 2

jQuery children() Method with syntax

<script type="text/javascript">
         $(document).ready(function(){         
            $( "ul.inner-ul" ).children().css( "background","yellow" );        
          });
</script>

Try it »


User Ans/Comments

📖 Read More


Advertisements