jQuery Test

Exam Type: MCQ Skill Test
Questions Type: Multiple Choice Questions
Total Questions: 40
Time Limit: 15 Minutes
Last Update May, 2025

Text Detail

jQuery linkedin Quiz

What is the difference between these two snippets?

$('button').on('click', function() {

 alert('you clicked the button!');

});

$('button').click(function() {

 alert('you clicked the button!');

});

  • Nothing. .click(function) is a shorter way to write .on('click', function).
  • The second snippet will not function.
  • Only the second one will work; jQuery does not have a function called .on.
  • The first snippet will execute for every button on the page; the second will apply only to the first button.

jQuery linkedin assessment

What does this line of code do?

jQuery('p');

  • aliases jQuery to a variable p
  • selects all paragraphs on the page
  • loads a paragraph tag from a remote server using AJAX
  • creates a new paragraph tag and inserts it into the body tag

linkedin jQuery Quiz answers

Given this HTML code, how can you use one line to show the button if it is hidden, and hide it if it is visible?

  • $('.btn-primary').showHide();
  • $('.btn-primary').css({ display: 'block' });
  • $('.btn-primary').not(':visible').show();
  • $('.btn-primary').toggle();

linkedin jQuery assessment

What is jQuery?

  • jQuery is a bridge between Java and Javascript that makes native apps easier to write.
  • jQuery is a plugin for JavaScript that makes database queries easier to write.
  • jQuery is a collection of JavaScript functions that makes finding and manipulating elements on a page, AJAX, and other things easier. 
  • jQuery is a Chrome extension that allows users to create their own extensions with just a few lines of JavaScript.

linkedin learning jQuery

You want to create a new jQuery plugin called linkUpdater that can be chained onto other jQuery selectors like a normal plugin. The new plugin 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?

( function( $ ) {

 "use strict";

 $.linkUpdater = function() {

 this.find('a').attr('target', '_blank');

 }

} )( jQuery );

 

  • In order to be used by other code, plugins must be added to the global namespace, not wrapped in a function expression.
  • This needs to be wrapped, like "$(this)", in order to be chained in a plugin.
  • jQuery plugins can't be safely authored in strict mode.
  • The plugin should extend jQuery.fn, not jQuery itself.
© 2025 Skill Test Answer. All Rights Reserved