Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update jquery-quiz.md #3099

Merged
merged 1 commit into from
Feb 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions jquery/jquery-quiz.md
Original file line number Diff line number Diff line change
Expand Up @@ -964,9 +964,9 @@ $('.item').parents('.navigation').css('font-weight', 'bold');

#### Q53. How can you ensure that some code executes only when a class `active` appears on an element?

- [x] `$('.element').attr('class', 'active')`
- [ ] `$('.element').attr('class', 'active')`
- [ ] `$('.element').with('.active')`
- [ ] `$('.element').hasClass('active')`
- [x] `$('.element').hasClass('active')`
- [ ] `$('.active').then()`

#### Q54. jQuery has a main function for handling AJAX, and several shorthand function including `load()` that make calling that main function easier. Given this HTML snippet, how can you insert only the second snippet from the source.html file (`div#one`) into the `#load-me` div on-demand via AJAX?
Expand Down Expand Up @@ -1045,10 +1045,10 @@ function listResponder(evt) {
}
```

- [ ] `$('.clickable-list).click(listResponder);`
- [x] `$('.clickable-list).on('click', 'li', listResponder);`
- [ ] `$('.clickable-list).on('click, append', listResponder);`
- [ ] `$('.clickable-list).each(function() { $(this).click(listResponder); });`
- [ ] `$('.clickable-list').click(listResponder);`
- [x] `$('.clickable-list').on('click', 'li', listResponder);`
- [ ] `$('.clickable-list').on('click, append', listResponder);`
- [ ] `$('.clickable-list').each(function() { $(this).click(listResponder); });`

#### Q58. What is the difference between $('p').find('a') and $('p').children('a')?

Expand Down Expand Up @@ -1117,7 +1117,7 @@ $(document).trigger('myCustomEvent');
```

- [ ] `Custom events are at least an order of magnitude faster than helper functions`
- [x] `Custom events can be listened for and acted upon across one or more scripts without needing to keep helper funtions in scope`
- [x] `Custom events can be listened for and acted upon across one or more scripts without needing to keep helper functions in scope`
- [ ] `Handler functions for custom events are less likely to be mangled by minification and obfuscation build tools`
- [ ] `It is easier to write documentation for custom events than it is for helper functions`

Expand Down