Guest User

Untitled

a guest
May 20th, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. <ul>
  2. <li>Item 1</li>
  3. <li>Item 2
  4. <ul>
  5. <li>Item 2.1</li>
  6. <li>Item 2.2</li>
  7. </ul>
  8. </li>
  9. <li>Item 3</li>
  10. </ul>
  11.  
  12. $("ul > li").addClass("blah");
  13.  
  14. $("ul li").addClass("blah");
  15.  
  16. #foo > * > * > .bar
  17.  
  18. $(".testit > a") //match the first <a> tag below
  19. $(".testit a") // matches all <a> tag below
  20.  
  21. <p class="testit">
  22. <a href="#">All the rules will match this</a>
  23. <span>
  24. <a href="#">second rule can only select this</a>
  25. </span>
  26. </p>
Add Comment
Please, Sign In to add comment