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. 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()
3. 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".
4. 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: $().
5. 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")
6. 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.
7. 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.
8. 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.
9. 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.
10. 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.
Discussion