Horje Website
Selecting the Specific Descendant Elements in jQuery – Learn Get specific descendants of an element – jQuery Code

Selecting the Specific Descendant Elements in jQuery – Learn Get specific descendants of an element

Selecting the Specific Descendant Elements in jQuery - Learn Get specific descendants of an element - jQuery Code


 
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Selecting the Specific Descendant Elements in jQuery</title>
  6. <style>
  7. *{
  8. margin: 10px;
  9. }
  10. .frame{
  11. border: 2px solid green;
  12. }
  13. </style>
  14. <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
  15. <script>
  16. $(document).ready(function(){
  17. $("div").find("li").addClass("frame");
  18. });
  19. </script>
  20. </head>
  21. <body>
  22. <div class="container">
  23. <h1>Hello World</h1>
  24. <p>This is a <em>simple paragraph</em>.</p>
  25. <ul>
  26. <li>Item One</li>
  27. <li>Item Two</li>
  28. </ul>
  29. </div>
  30. </body>
  31. </html>



Try Your Self ->



Published:
September 16, 2020
Author:
admin
Category:
jQuery Advanced, jQuery Source Code
Views:
14

This article was posted in jQuery Advanced, jQuery Source Code and tagged , , . Bookmark the permalink. Follow comments with the RSS feed for this post.Post a Comment or leave a trackback: Trackback URL.

Leave a Reply

Your email address will not be published. Required fields are marked *

 

Horje © 2011 - 2022