YouTube

Got a YouTube account?

New: enable viewer-created translations and captions on your YouTube channel!

English subtitles

← Filters Solution

Get Embed Code
5 Languages

Showing Revision 3 created 05/25/2016 by Udacity Robot.

  1. To find the h1 element,
    I simply used the siblings method and
  2. passed in the filter h1.
  3. For the kids, I used find and
    a passed in a *.
  4. I'll come back to this in a second.
  5. And then for the parents, I used the
    .parents method and passed in the string
  6. div, otherwise I would select all
    the parents, including the body.
  7. To test this, I press Test Run, saw the
    page come up, and then open dev tools.
  8. I see that I've gotten h1,
    like I expected.
  9. I see the children of article-list.
  10. And I also see the two divs
    that we were expecting.
  11. Now why did I pass a * to find?
  12. Looking at the documentation for it,
    we see that the selector isn't optional.
  13. We've got to included it.
  14. But if we scroll down, we find this
    message, which says that if we want to
  15. select all of the descendant elements,
    or all of the children, we can simply
  16. pass in the universal selector, which
    in this case is a string of a star.
  17. See?
  18. Reading documentation
    is super important.
  19. Okay, enough with these selections.
  20. Now I want you to start manipulating the