jQuery children() Method
home
Run
screen_rotation
fullscreen
cloud_download
navigate_before
<!DOCTYPE html> <html> <head> <title>add - jQuery Example</title> <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"> </script> <script type="text/javascript"> $(document).ready(function(){ $( "ul.inner-ul" ).children().css( "background","yellow" ); }); </script> </head> <body> <div>Demo Div</div> <ul> <li>First Item</li> <li>Second Item</li> <li> <ul class="inner-ul"> <li>Inner One</li> <li>Inner Two</li> </ul> </li> </ul> </body> </html>
<!DOCTYPE html> <html> <head> <title>add - jQuery Example</title> <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"> </script> <script type="text/javascript"> $(document).ready(function(){ $( "ul.inner-ul" ).children().css( "background","yellow" ); }); </script> </head> <body> <div>Demo Div</div> <ul> <li>First Item</li> <li>Second Item</li> <li> <ul class="inner-ul"> <li>Inner One</li> <li>Inner Two</li> </ul> </li> </ul> </body> </html>
Copyrights@tutorialsplane.com