Prev Demo
jQuery
>
.Children() - Get All Children Elements
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> </head> <body> <!DOCTYPE html> <html> <head> <title>Demo</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> </head> <body> <p style="background-color:red;">Qnet is the parent Company.</p> <hr /> <div> <ol> <li>We are one</li> <li>Ocean</li> <li>Season</li> </ol> </div> These are all the child companies <script> $("div").children().css("background", "red"); </script> </body> </html> </body> </html>
Note: We DO NOT save your trial code in our database.
Output