jQuery MCQ Questions
11. jQuery is a ___________.
A. lightweight
B. heavyweight
C. Both A and B
D. None of the above
View Answer
Ans : A
Explanation: jQuery is a lightweight, "write less, do more", JavaScript library.
12. Which code will hides the current element?
A. $("p").hide()
B. $(this).hide()
C. $(".test").hide()
D. $("#test").hide()
View Answer
Ans : B
Explanation: $(this).hide() - hides the current element.
13. jQuery uses ________ syntax to select elements
A. CSS
B. Javascript
C. HTML
D. SQL
View Answer
Ans : A
Explanation: jQuery uses CSS syntax to select elements.
14. Which selector will finds elements with a specific class?
A. id
B. element
C. object
D. class
View Answer
Ans : D
Explanation: The jQuery .class selector finds elements with a specific class.
15. Which of the following is correct Syntax to find an element with a specific id?
A. $("!test")
B. $("p")
C. $("#test")
D. $("&test")
View Answer
Ans : C
Explanation: To find an element with a specific id, write a hash character, followed by the id of the HTML element:$("#test")
16. The _____________ method attaches an event handler function to an HTML element.
A. ready()
B. click()
C. dblclick()
D. mouseenter()
View Answer
Ans : B
Explanation: The click() method attaches an event handler function to an HTML element
17. The blur() method attaches an event handler function to an HTML form field.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: True, The blur() method attaches an event handler function to an HTML form field.
18. The on() method attaches an event handler function to an HTML form field.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : B
Explanation: The on() method attaches one or more event handlers for the selected elements.
19. Which built-in method sorts the elements of an array?
A. changeOrder(order)
B. order()
C. sort()
D. All of the above
View Answer
Ans : C
Explanation: sort() method sorts the elements of an array.
20. Which of the following is a single global function defined in the jQuery library?
A. jQuery()
B. $()
C. Queryanalysis()
D. global()
View Answer
Ans : A
Explanation: The jQuery library defines a single global function named jQuery(). This function is so frequently used that the library also defines the global symbol $ as a shortcut for it. The $ sign it’s just an alias to jQuery(), then an alias to a function which is used as a selector element.
Discussion