jQuery MCQs – Multiple Choice Questions and Answers – Part 2
Multiple choice questions and answers (MCQs) on jQuery to prepare for exams, tests, and certifications. These questions are taken from a real written exam and some parts are taken from an interview. So you will find questions on basic techniques such as manipulating the DOM, web standards, CSS selector, DOM element, and more. This quiz will easily prepare anyone to pass their online test.
1. Which of the following is an overloaded function?
A jQuery()
B $()
C script()
D jQuery() and $()
2. JQuery code to set the background color of all “<span>” in blue?
A $("span").style("background-color", "blue");
B $("span").css("background-color", "blue");
C jQuery("span").style("background-color", "blue");
D None of the above
3. Which of the following replaces $(document).ready(f)
?
A jQuery(f)
B $(f)
C #(f)
D None of the above
4. $("span.foo").
What does it select?
A All span elements with id = “foo”
B all span elements with class = “foo”
C The first span element with id = “foo”
D The first span element with class = “foo”
5. Which jQuery method to set one or more style properties for selected elements?
A css()
B html()
6. What are jQuery’s features?
A Useful collection of methods for manipulating selected items
B Efficient query method to find all document elements
C Syntax for referencing document elements
D All the answers are true
7. Why do you use jQuery?
9. The ______ method is used to make an asynchronous HTTP request?
A jQuery.ajaxAsync()
B jQuery.ajax()
C jQuery.async()
D None of the above
10. $("div#frame1 .bd1")
What does it select?
A The first element with id = “bd1” in any div element with class = “frame1
B The first element with class = “bd1” in the first element div with id = “frame1”
C All elements with class = “bd1” in the first element div with id = “frame1”
D None of the above