Return to Video

Filters Solution

  • 0:00 - 0:04
    To find the h1 element,
    I simply used the siblings method and
  • 0:04 - 0:06
    passed in the filter h1.
  • 0:06 - 0:11
    For the kids, I used find and
    a passed in a *.
  • 0:11 - 0:12
    I'll come back to this in a second.
  • 0:12 - 0:17
    And then for the parents, I used the
    .parents method and passed in the string
  • 0:17 - 0:21
    div, otherwise I would select all
    the parents, including the body.
  • 0:21 - 0:26
    To test this, I press Test Run, saw the
    page come up, and then open dev tools.
  • 0:26 - 0:29
    I see that I've gotten h1,
    like I expected.
  • 0:29 - 0:31
    I see the children of article-list.
  • 0:31 - 0:33
    And I also see the two divs
    that we were expecting.
  • 0:35 - 0:38
    Now why did I pass a * to find?
  • 0:38 - 0:42
    Looking at the documentation for it,
    we see that the selector isn't optional.
  • 0:42 - 0:43
    We've got to included it.
  • 0:43 - 0:48
    But if we scroll down, we find this
    message, which says that if we want to
  • 0:48 - 0:52
    select all of the descendant elements,
    or all of the children, we can simply
  • 0:52 - 0:57
    pass in the universal selector, which
    in this case is a string of a star.
  • 0:57 - 0:58
    See?
  • 0:58 - 1:01
    Reading documentation
    is super important.
  • 1:01 - 1:03
    Okay, enough with these selections.
  • 1:03 - 1:04
    Now I want you to start manipulating the
Cím:
Filters Solution
Leírás:

more » « less
Video Language:
English
Team:
Udacity
Projekt:
ud245 - Intro to JQuery
Duration:
01:05
Udacity Robot edited Angol subtitles for 01-18 Filters_Solution
Udacity Robot edited Angol subtitles for 01-18 Filters_Solution
Cogi-Admin edited Angol subtitles for 01-18 Filters_Solution

English subtitles

Felülvizsgálatok Compare revisions