Home > jQuery > Quizzes > jQuery Quiz
jQuery Quiz
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 13% Most missed: “Given this set of checkboxes, how can you select the one with the value 'blimp'?”

jQuery MCQs For LinkedIn Skill Assessments.

jQuery Quiz
Time left 00:00
25 Questions

1. When incorporating a plugin into a project, what are the important steps for basic installation and usage?
2. We want to create a new jQuery plugin called linkUpdater that can be chained onto other jQuery selector like a normal plugin. It should update all the links in the referenced collection so they open in new windows or tabs. Below is the first cut. What is one problem with this plugin?
js
'user strict';
($.linkUpdater = function () {
this.find('a').attr('target', '_blank');
})(jQuery);
3. When using the 'clone()' function to duplicate an element, what is one of the main concerns your code needs to watch out for?
4. The following page snippet includes a couple of messages in a list, and a code snippet that retrieves a few hundred messages from an API endpoint using AJAX. How can you add these new items to the .message-area--list element in the most performant way?
html


  • Existing message 1

  • Existing message 2



$.get('//example.com/api/v1/message').done(function (data) { var tonsOfItems = data.messages; // add
all these messages to a large page });
5. You want to have a ball that is created from an HTML element (id=ball) move down and to the right of its original location when clicked, and move back to its original place when finished. What snippet, added to the code below, would do this?
js
$('#ball').click(function () {
// Our code goes here
});
6. Which property of the jQuery event object references the DOM object that dispatched an event?
7. What does '$()' mean in jQuery?
8. Though jQuery offers visual effects, it is considered a best practice to use CSS to set up different states triggered by classes, where it makes sense. What's the easiest way to enable and disable a class bounce on an element with the ID dialog?
9. What is the correct way to check how many paragraphs exist on a page using jQuery?
10. Along with DOM traversal and manipulation, jQuery offers several general-purpose helper functions that fill in some JavaScript gaps, especially before ES2015. Which is NOT a jQuery utility function?
11. Consider the following markup, used to lay out three balls on the page, all hidden. How can you select the green ball, make it faded in over the course of three seconds, and log a console message when the animation has finished?
html





12. How can you ensure that some code executes only when a class 'active' appears on an element?
13. Using event delegation, you can listen for events on a lot of different items without having to attach separate listeners to each one. But there are times when you may want to check the type of item receiving the event before doing anything, such as checking if an image was clicked versus a text field. Given the starter code below, which choice shows what jQuery provides to help with that process?
html


js
$('#sidebar').click(function (evt) {
var $target = $(evt.target);
// What goes here?
});
14. There are many ways to create elements that can be added to the page. Which answer is NOT one of those ways, assuming you have the following on the page?
html

15. You want to implement the behavior of an effect like 'slideDown()' manually using 'animate()'. What is one critical point you need to remember?
16. You want to create a custom right-click menu. How might you start the code?
17. What is the difference between $('p').find('a') and $('p').children('a')?
18. The '.addClass()' and '.removeClass()' methods can accept functions as arguments. What does this function do?
js
$('#menu').addClass(function () {
return $('body').attr('class');
});
19. Given the snippet of HTML below, what is the difference between the two lines that follow it?
html

  • Item 1

  • Item 2

  • Item 3

  • Item 4



js
$('ul').find('li').get(2);
$('ul').find('li').eq(2);
20. What is jQuery?
21. What is the main difference between the 'contents()' and 'children()' functions?
22. Let's say you have a page with just one link on it. How can you change the anchor tag so it links to example.com?
23. Given this snippet of HTML and jQuery code, what will the result look like?
html

  • Item 1

  • Item 2


  • Item 3

    • Sub Item 1

    • Sub Item 2





'$('.items').find('.active').nextAll().addClass('after-active');'
24. What is the difference between '$('header').html()' and '$('header').text()'?
25. What is tricky about jQuery's nth- filters (:nth-child, :nth-of-type, etc.) relative to other filters?

⚡ Recently practiced quizzes in this topic
Live quiz activity