Hello jQuery Lesson 3 - B
More using elements without declaring css beforehand
using parent selectors for jQuery to grab
Here we will remove the css class from these elements using '.removeClass('emphasis'):
- Item 1 - li:first-child
- Item 2
- Item 3
- A Hello from the nest - li li: first-child
- B
- C
Family-style
Using 'closest' instead of 'parent'
- parent
- parents
- gets all parents, all the way up to the root: document
- children
- Familia used as a handle
- gets all children, grandchildren, etc, recursively
- closest
- gets only the first item that matches, searching up the DOM tree from the current element