Kyle beings walking through the solution to the first task. He creates a click event handler and stops the event from propagating.
(asian music)…- All that was a long preamble to say…we want to get, we want to attach click handlers…to these two links.…And there's a couple of different ways that we can do that,…but the easiest is for me to say,…you'll notice that there is a control, a js-controls…wrapper div around the two header links.…So if I were to find an element by attribute,…and this is the syntax you use for finding…things by attribute, we put brackets in.…
Rel=js-controls…what that means is go find any element in the page…that has a rel attribute whose value is js-controls.…So I'm saying here go find one of those,…and get me…the child element…js-register.…
Ah, it's a question about rels having…more than one element, yeah,…as you'll notice here in my html…I've got multiple rel attributes here,…and I only care about one of 'em, it's the js-register.…Alright, so now I want to say a child element…where the rel attribute has js-control, or js-register…somewhere in it, so that is almost the same.…Except we use *=js-register.…
That's one way of me getting at that link.…
Note: This course was created on 03/29/2016 by Frontend Masters. We are pleased to host this content in our library.
- Carousels, panes, and modules
- Middle-end architecture
- Secure phrase generator
- Routing functions
- Calling the API
- Rendering on the page
- Shared data validation
Skill Level Intermediate
2. Organizing Code
5. Adding a Shared Module
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.