jQuery - Online Quiz
Following quiz provides Multiple Choice Questions (MCQs) related to jQuery Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.
Q 1 - How can you get the type of arguments passed to a function?
Answer : A
Explaination
Using typeof operator, we can get the type of arguments passed to a function.
Q 2 - Which built-in method calls a function for each element in the array?
Answer : C
Explaination
forEach() method calls a function for each element in the array.
Q 3 - Which of the following jQuery selector selects element with the given element id some-id?
Answer : B
Explaination
$('#some-id') selects the single element in the document that has an ID of some-id.
Q 4 - Which of the following jQuery method sets the html contents of an element?
Answer : A
Explaination
The html( val ) method sets the html contents of every matched element.
Q 5 - Which of the following jQuery method reduce the set of matched elements to a single element?
Answer : B
Explaination
The eq( index ) method reduces the set of matched elements to a single element.
Q 6 - Which of the following jQuery method reverts the most recent 'destructive' operation, changing the set of matched elements to its previous state?
Answer : B
Explaination
The end( ) method reverts the most recent 'destructive' operation, changing the set of matched elements to its previous state.
Q 7 - Which of the following jQuery method sets the width property of an element?
Answer : C
Explaination
The width( value ) method sets the width of every matched element.
Q 8 - Which of the following jQuery method returns a jQuery collection with the positioned parent of the first matched element?
Answer : B
Explaination
The offsetParent( ) method returns a jQuery collection with the positioned parent of the first matched element.
Q 9 - Which of the following jQuery method stops the bubbling of an event to parent elements?
Answer : C
Explaination
The stopPropagation() method of Event object stops the bubbling of an event to parent elements, preventing any parent handlers from being notified of the event.
Q 10 - Which of the following jQuery method serializes a set of input elements into a string of data?
Answer : C
Explaination
The serialize() method serializes a set of input elements into a string of data.