jQuery Quiz Questions 31-40

Sam Deering

Following on from jQuery Quiz Questions 21-30 here are questions 21-30. Hopefully you might learn something new about jQuery you didn’t know before. Once more if you find any mistakes please feel free to leave a comment with corrections. Enjoy!

Question 31

What does the event.stopPropagation() function do?

Answers

  • Bubbles up the DOM tree and stops at the closest parent element.
  • Bubbles up the DOM tree, preventing any parent handlers from being notified of the event.
  • Bubbles up the DOM and prevents other handlers on the same element from running.

Correct Answers
Bubbles up the DOM tree, preventing any parent handlers from being notified of the event.

see answer in action: http://www.jquery4u.com/function-demos/stoppropagation/
API: http://api.jquery.com/event.stopPropagation/

 


Question 32

What does the jQuery .clone() function do by default?

Answers

  • Create a deep copy of the set of matched elements excluding any attached events.
  • Create a shallow copy of the set of matched elements excluding any attached events.
  • Create a deep copy of the set of matched elements including any attached events.
  • Create a shallow copy of the set of matched elements including any attached events.

Correct Answers
Create a deep copy of the set of matched elements excluding any attached events.
API: http://api.jquery.com/clone/

 


Question 33

The jQuery .queue() function can be used to?

Answers

  • Queue up animation functions so they can run synchronously.
  • Queue up animation functions so they can run asynchronously.
  • There is no difference between .queue() and .animate() callback function.
  • jQuery has no such function.

Correct Answers
Queue up animation functions so they can run asynchronously.

API: http://api.jquery.com/queue/
This feature is similar to providing a callback function with an animation method, but does not require the callback to be given at the time the animation is performed.

 


Question 34

What does this code snippet do?

$(function() {
    //jQuery code
});

Answers

  • Runs the jQuery code when the DOM is ready.
  • Encapsulates the jQuery code protecting it from other code.
  • It essentially does the same thing as $(window).load() function.
  • All of the above.

Correct Answers
All of the above.
more info on answer: http://www.jquery4u.com/dom-modification/types-document-ready/
API: http://api.jquery.com/ready/

 


Question 35

Stats show that jQuery is used by roughly how many websites as at March 2013?

Answers

  • 45 million
  • 29 million
  • 19 million
  • 12 million

Correct Answers
19 million
source: http://trends.builtwith.com/javascript/jQuery

 


Question 36

Stats show that jQuery is used by roughly how many websites as at March 2014?

Answers

  • 45 million
  • 29 million
  • 19 million
  • 12 million

Correct Answers
45 million
source: http://trends.builtwith.com/javascript/jQuery
 


Question 37

Which statement is true about the jQuery Library final size?

Answers

  • The final 2.0.0 file is 9 percent smaller than the 1.9.1 file.
  • The final 2.0.0 file is 12 percent smaller than the 1.9.1 file.
  • The final 2.0.0 file is 18 percent smaller than the 1.9.1 file.
  • The final 2.0.0 file is 24 percent smaller than the 1.9.1 file.

Correct Answers
The final 2.0.0 file is 12 percent smaller than the 1.9.1 file.
source: http://blog.jquery.com/2013/04/18/jquery-2-0-released/

 


Question 38

What is a true about vanilla jsfiddle.net online coding tool?

Answers

  • jsfiddle supports Firebug.
  • jsfiddle supports Chrome Dev tools.
  • jsfiddle supports both Firebug and Chrome Dev tools.
  • jsfiddle supports Firebug Lite only.

Correct Answers
jsfiddle supports Firebug Lite only.
source: http://www.jquery4u.com/tools/firebug-jsfiddle/

 


Question 39

When was the initial release of the jQuery Library?

Answers

  • June 2006.
  • July 2006.
  • August 2006.
  • September 2006.

Correct Answers
August 2006.
source: http://en.wikipedia.org/wiki/JQuery

 


Question 40

Which statement is FALSE about the .closest(), .parent() and .parents() functions.

Answers

  • .closet() starts searching from the current element.
  • .parents() starts searching from the parent element.
  • .parent() is the same as .parents() but returns one element.
  • .parent() ends it’s search when it hits the first parent element.

Correct Answers
.parent() is the same as .parents() but returns one element.

The .parents() and.parent() methods are similar, except that the latter only travels a single level up the DOM tree.
API: http://api.jquery.com/parent/ http://api.jquery.com/parents/ http://api.jquery.com/closest/

 


Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

No Reader comments

Comments on this post are closed.