jQuery Multiple choice Questions & Answers

Posted On:December 31, 2018, Posted By: Latest Interview Questions, Views: 4298, Rating :

Best jQuery Objective Questions and Answers

Dear Readers, Welcome to jQuery Objective Questions have been designed specially to get you acquainted with the nature of questions you may encounter during your Job interview for the subject of jQuery MCQs. These objective type jQuery questions are very important for campus placement test and job interviews. As per my experience good interviewers hardly plan to ask any particular question during your Job interview and these model questions are asked in the online technical test and interview of many IT companies.

1. Which of the following is correct?

a. jQuery is a JavaScript Library
b. jQuery is a JSON Library
Ans: a
objective-type-questions-and-answers

2. jQuery uses CSS selectors and XPath expressions to select elements?

a. False
b. True
Ans: b
 

3. Which sign does jQuery use as a shortcut for jQuery?

a. $ sign
b. % sign
c. ? Sign
Ans: a
 

4. Is jQuery a W3C standard?

a. Yes
b. No
Ans: b
 

5. $(“span”). What does it select?

a. All span elements
b. The first span element
Ans: a
 

6. Is jQuery a library for client scripting or server scripting?

a. Client scripting
b. Server scripting
Ans: a
 

7. Is it possible to use jQuery together with AJAX?

a. Yes
b. No
Ans: a
 

8. The jQuery html() method works for both HTML and XML documents

a. False
b. True
Ans: a
 

9. jQuery code to set the background color of all span elements to blue?

a. $(“span”).style(“background-color”,”blue”);
b. $(“span”).manipulate(“background-color”,”blue”);
c. $(“span”).css(“background-color”,”blue”);
d. $(“span”).layout(“background-color”,”blue”);
Ans: c
 

10. $(“span.intro”). What does it select?

a. The first span element with class=”intro”
b. The first span element with id=”intro”
c. All span elements with id=”intro”
d. All span elements with class=”intro”
Ans: d
 

11. jQuery method to hide selected elements?

a. visible(false)
b. hidden()
c. display(none)
d. hide()
Ans: d
 

12. jQuery method to set one or more style properties for selected elements?

a. style()
b. css()
c. html()
Ans: b
 

13. jQuery method is used to perform an asynchronous HTTP request?

a. jQuery.ajaxAsync()
b. jQuery.ajaxSetup()
c. jQuery.ajax()
Ans: c
 

14. What scripting language is jQuery written in?

a. VBScript
b. C++
c. JavaScript
d. C#
Ans: c
 

15. $(“div#id1 .cl1?). What does it select?

a. The first element with id=”cl1? inside any div element with class=”id1?
b. All elements with class=”cl1? inside the first div element with id=”id1?
c. All div elements with id=”id1? or class=”cl1?
Ans: b
 

16. Do you wonder why we do not have type=”text/javascript” inside the <script> tag?

a. It is not required in HTML5
b. It is required in HTML5
Ans: a
 

17. Which of the following is correct?

a. jQuery is a JSON Library
b. jQuery is a JavaScript Library
Ans: a
 

18. jQuery uses CSS selectors and XPath expressions to select elements?

a. False
b. True
Ans: b
 

19. With jQuery, look at the following selector: $(“div”). What does it select?

a. All div elements
b. The first div element
Ans: b
 

20. Is jQuery a library for client scripting or server scripting?

a. Client scripting
b. Server scripting
Ans: a
 

21. Is it possible to use jQuery together with AJAX?

a. No
b. Yes
Ans: b
 

22. The jQuery html() method works for both HTML and XML documents

a. True
b. False
Ans: b
 

23. 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: c
 

24. Which jQuery function is used to prevent code from running, before the document is finished loading?

a. $(document).ready()
b. $(document).load()
c. $(body).onload()
Ans: a
 

25. Which jQuery method should be used to deal with name conflicts?

a. noConflict()
b. noNameConflict()
c. conflict()
d. nameConflict()
Ans: a
 

26. Which jQuery method is used to switch between adding/removing one or more classes (for CSS) from selected elements?

a. switchClass()
b. toggleClass()
c. altClass()
d. switch()
Ans: b
 

27. Is jQuery a W3C standard?

a. Yes
b. No
Ans: b
 

28. Which sign does jQuery use as a shortcut for jQuery?

a.$ sign
b.% sign
c.? Sign
Ans: a
 

29. jQuery code to set the background color of all span elements to blue?

a. $("span").style("background-color","blue");
b. $("span").manipulate("background-color","blue");
c. $("span").css("background-color","blue");
d. $("span").layout("background-color","blue");
Ans: c
 

30. $("span.intro"). What does it select?

a. The first span element with class="intro"
b. The first span element with id="intro"
c. All span elements with id="intro"
d. All span elements with class="intro"
Ans: d