Top Most JQuery multiple choice questions
1. jQuery is a
a). JavaScript Library.
b).JavaScript Language
c).JavaScript Method
d). PHP Method
Ans: a
2. jQuery uses CSS selectors to select elements?
A. False
B. True
Ans:B
3. Which sign does jQuery use as a shortcut for jQuery?
A. the % sign
B. the ? Sign
C. the $ sign
Ans: C
4. With jQuery, look at the following selector: $(“div”). What does it select?
A. All div elements
B. The first div element
Ans: A
5. Is jQuery a library for client scripting or server scripting?
A. Server scripting
B. Client scripting
Ans:A
6. Is it possible to use jQuery together with AJAX?
A. No
B. Yes
Ans:B
7. The jQuery html() method works for both HTML and XML documents
A. False
B. True
Ans:A
8. What is the correct jQuery code to set the background color of all p elements to red?
A. $(“p”).layout(“background-color”,”red”);
B. $(“p”).manipulate(“background-color”,”red”);
C. $(“p”).css(“background-color”,”red”);
D. $(“p”).style(“background-color”,”red”);
Ans:C
9. With jQuery, look at the following selector: $(“div.intro”). What does it select?
A. The first div element with class=”intro”
B. The first div element with id=”intro”
C. All div elements with class=”intro”
D. All div elements with id=”intro”
Ans:C
10. Which jQuery method is used to hide selected elements?
A. hidden()
B. hide()
C. visible(false)
D. display(none)
Ans:B
11. Which jQuery method is used to set one or more style properties for selected elements?
A. css()
B. html()
C. style()
Ans:A
12. Which jQuery method is used to perform an asynchronous HTTP request?
A. jQuery.ajaxAsync()
B. jQuery.ajax()
C. jQuery.ajaxSetup()
Ans:B
13. What is the correct jQuery code for making all div elements 100 pixels high?
A. $(“div”).height=”100″
B. $(“div”).height(100)
C. $(“div”).yPos(100)
Ans:C
14. Which statement is true?
A. To use jQuery, you must buy the jQuery library at www.jquery.com
B. To use jQuery, you do not have to do anything. Most browsers (Internet Explorer, Chrome, Firefox and Opera) have the jQuery library built in the browser
C. To use jQuery, you can refer to a hosted jQuery library at Google
Ans: A
15. What scripting language is jQuery written in?
A. VBScript
B. JavaScript
C. C#
D. C++
Ans: B
16. Which jQuery function is used to prevent code from running, before the document is finished loading?
A. $(document).load()
B. $(document).ready()
C. $(body).onload()
Ans:C
17. Which jQuery method should be used to deal with name conflicts?
A. noNameConflict()
B. noConflict()
C. nameConflict()
D. conflict()
Ans:D
18. Which jQuery method is used to switch between adding/removing one or more classes (for CSS) from selected elements?
A. toggleClass()
B. switch()
C. altClass()
D. switchClass()
Ans: D
19. Look at the following jQuery selector: $(“div#intro .head”). What does it select?
A. The first element with id=”head” inside any div element with class=”intro”
B. All elements with class=”head” inside the first div element with id=”intro”
C. All div elements with id=”intro” or class=”head”
Ans:C
20. Is jQuery a W3C standard?
A. No
B. Yes
Ans: B
21. Which statement best explains what “unobtrusive JavaScript” is?
A. JavaScript that doesn’t annoy users
B. JavaScript that is separate from HTML
C. JavaScript that does not affect a web page
D. JavaScript that works even with scripting turned off
Ans: B