jQuery MCQ Questions And Answers
jQuery MCQ : This section focuses on "Basics" of jQuery. These Multiple Choice Questions (MCQ) should be practiced to improve the jQuery skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.
1. What is true about jquery?
A. jQuery is a JavaScript Library.
B. jQuery greatly simplifies JavaScript programming.
C. jQuery is easy to learn.
D. All of the above
View Answer
Ans : D
Explanation: jQuery is a JavaScript Library.jQuery greatly simplifies JavaScript programming.jQuery is easy to learn.
2. 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.
3. Basic syntax is:?
A. $action(selector)
B. $selector.action()
C. $(selector).action()
D. $(selector).action
View Answer
Ans : C
Explanation: Basic syntax is: $(selector).action()
4. 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.
5. Which code will hides all elements with class="test"?
A. hides all <p> elements.
B. hides all elements with class="test".
C. hides the element with id="test".
D. None of the above
View Answer
Ans : B
Explanation: $(".test").hide() - hides all elements with class="test".
6. 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.
7. All selectors in jQuery start with the ?
A. dollar sign
B. parentheses
C. Both A and B
D. Comma
View Answer
Ans : C
Explanation: All selectors in jQuery start with the dollar sign and parentheses: $().
8. 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.
9. Which of the following is correct Syntax to find elements with a specific class?
A. $("!test")
B. $("p")
C. $("#test")
D. $(".test")
View Answer
Ans : D
Explanation: To find elements with a specific class, write a period character, followed by the name of the class : $(".test")
10. 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")
11. All the different visitors actions that a web page can respond to are called?
A. action
B. event
C. fade
D. slide
View Answer
Ans : B
Explanation: All the different visitors actions that a web page can respond to are called events.
12. 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
13. mouseenter() method is used for?
A. method attaches an event handler function to an HTML element
B. method attaches an event handler function to an HTML element
C. attaches an event handler function to an HTML element.
D. method attaches an event handler function to an HTML element
View Answer
Ans : C
Explanation: The mouseenter() method attaches an event handler function to an HTML element.
14. 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.
15. focus() method is used for?
A. attaches an event handler function to an HTML form field
B. takes two functions and is a combination of the mouseenter() and mouseleave() methods
C. attaches an event handler function to an HTML element
D. attaches an event handler function to an HTML element
View Answer
Ans : A
Explanation: The focus() method attaches an event handler function to an HTML form field.
16. 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.
17. Which built-in method removes the last element from an array and returns that element?
A. last()
B. get()
C. pop()
D. None of the above
View Answer
Ans : C
Explanation: pop() method removes the last element from an array and returns that element.
18. 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.
19. Which of the following is not the feature of jQuery?
A. Efficient query method for finding the set of document elements
B. Expressive syntax for referring to elements in the document
C. Useful set of methods for manipulating selected elements
D. Powerful functional programming techniques is not used for operating on sets of elements as a group
View Answer
Ans : D
Explanation: Powerful functional programming techniques is not used for operating on sets of elements as a group is not the feature of jQuery.
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