jQuery - Mock Test


Advertisements

This section presents you various set of Mock Tests related to jQuery Framework. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.

Questions and Answers

jQuery Mock Test III

Q 1 - Which of the following jQuery method gets a set of elements containing all of the unique immediate children of each of the matched set of elements?

A - getChild( selector )

B - children( [selector])

C - getChildren(selector)

D - None of the above.

Answer : B

Explaination

The children( [selector]) method gets a set of elements containing all of the unique immediate children of each of the matched set of elements.

Q 2 - Which of the following jQuery method gets a set of elements containing the closest parent element that matches the specified selector, the starting element included?

A - getNearest( selector )

B - getClosest( [selector])

C - closest(selector)

D - None of the above.

Answer : C

Explaination

The closest( selector ) method gets a set of elements containing the closest parent element that matches the specified selector, the starting element included.

Q 3 - Which of the following jQuery method finds all the child nodes inside the matched elements (including text nodes), or the content document, if the element is an iframe?

A - getChildren( selector )

B - getContents( [selector])

C - contents(selector)

D - None of the above.

Answer : C

Explaination

The contents( ) method finds all the child nodes inside the matched elements (including text nodes), or the content document, if the element is an iframe.

Q 4 - Which of the following jQuery method reverts the most recent 'destructive' operation, changing the set of matched elements to its previous state?

A - revert( )

B - end( )

C - undo( )

D - None of the above.

Answer : B

Explaination

The end( ) method reverts the most recent 'destructive' operation, changing the set of matched elements to its previous state.

Q 5 - Which of the following jQuery method searches for descendent elements that match the specified selectors?

A - locate( selector )

B - find( selector)

C - search( selector )

D - None of the above.

Answer : B

Explaination

The find( selector ) method searches for descendent elements that match the specified selectors.

Q 6 - Which of the following jQuery method gets a set of elements containing the unique next siblings of each of the given set of elements?

A - locateNext( selector )

B - getNext( selector)

C - next( selector )

D - None of the above.

Answer : C

Explaination

The next( [selector] ) gets a set of elements containing the unique next siblings of each of the given set of elements.

Q 7 - Which of the following jQuery method finds all sibling elements after the current element?

A - locateNextAll( selector )

B - getNextAll( selector)

C - nextAll( selector )

D - None of the above.

Answer : C

Explaination

The nextAll( [selector] ) finds all sibling elements after the current element.

Q 8 - Which of the following jQuery method returns a jQuery collection with the positioned parent of the first matched element?

A - offsetParent( selector )

B - offset( selector)

C - parent( selector )

D - None of the above.

Answer : A

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 gets the direct parent of an element?

A - offsetParent( selector )

B - offset( selector)

C - parent( selector )

D - None of the above.

Answer : C

Explaination

The parent( [selector] ) method gets the direct parent of an element. If called on a set of elements, parent returns a set of their unique direct parent elements.

Q 10 - Which of the following jQuery method gets a set of elements containing the unique ancestors of the matched set of elements?

A - offsetParent( selector )

B - offset( selector)

C - parents( selector )

D - None of the above.

Answer : C

Explaination

The parents( [selector] ) method gets a set of elements containing the unique ancestors of the matched set of elements (except for the root element).

Q 11 - Which of the following jQuery method gets a set of elements containing the unique previous siblings of each of the matched set of elements?

A - parents( selector )

B - prev( selector)

C - siblings( selector )

D - None of the above.

Answer : B

Explaination

The prev( [selector] ) method gets a set of elements containing the unique previous siblings of each of the matched set of elements.

Q 12 - Which of the following jQuery method finds all sibling elements in front of the current element?

A - parents( selector )

B - prevAll( selector)

C - siblings( selector )

D - None of the above.

Answer : B

Explaination

The prevAll( [selector] ) method finds all sibling elements in front of the current element.

Q 13 - Which of the following jQuery method gets a set of elements containing all of the unique siblings of each of the matched set of elements?

A - parents( selector )

B - prevAll( selector)

C - siblings( selector )

D - None of the above.

Answer : C

Explaination

The siblings( [selector] ) method gets a set of elements containing all of the unique siblings of each of the matched set of elements.

Q 14 - Which of the following jQuery method gets the style property of an element?

A - getClass( name )

B - getStyle( name)

C - css( name )

D - None of the above.

Answer : C

Explaination

The css( name ) method returns a style property on the first matched element.

Q 15 - Which of the following jQuery method sets the style property of an element?

A - setClass( name, value )

B - setStyle( name, value)

C - css( name, value )

D - None of the above.

Answer : C

Explaination

The css( name, value ) method sets a style property on the first matched element.

Q 16 - Which of the following jQuery method sets the height property of an element?

A - setCSSHeight( value )

B - setHeight( value)

C - height( value )

D - None of the above.

Answer : C

Explaination

The height( value ) method sets the CSS height of every matched element.

Q 17 - Which of the following jQuery method gets the height property of an element?

A - getCSSHeight( )

B - getHeight( )

C - height( )

D - None of the above.

Answer : C

Explaination

The height( ) method gets the CSS height of every matched element.

Q 18 - Which of the following jQuery method sets the width property of an element?

A - setCSSWidth( value )

B - setWidth( value)

C - width( value )

D - None of the above.

Answer : C

Explaination

The width( value ) method sets the width of every matched element.

Q 19 - Which of the following jQuery method gets the width property of an element?

A - getCSSWidth( )

B - getWidth( )

C - width( )

D - None of the above.

Answer : C

Explaination

The width( ) method gets the width of every matched element.

Q 20 - Which of the following jQuery method gets the inner height (excluding the border) of an element?

A - getCSSHeight( )

B - innerHeight( )

C - getInnerHeight( )

D - None of the above.

Answer : B

Explaination

The innerHeight( ) method gets the inner height (excludes the border and includes the padding) for the first matched element.

Q 21 - Which of the following jQuery method gets the inner width (excluding the border) of an element?

A - getCSSWidth( )

B - innerWidth( )

C - getInnerWidth( )

D - None of the above.

Answer : B

Explaination

The innerWidth( ) method gets the inner width (excludes the border and includes the padding) for the first matched element.

Q 22 - Which of the following jQuery method gets the current offset of the first matched element, in pixels, relative to the document?

A - offset( )

B - offsetParent( )

C - position( )

D - None of the above.

Answer : A

Explaination

The offset( ) method gets the current offset of the first matched element, in pixels, relative to the document.

Q 23 - Which of the following jQuery method returns a jQuery collection with the positioned parent of the first matched element?

A - offset( )

B - offsetParent( )

C - position( )

D - None of the above.

Answer : B

Explaination

The offsetParent( ) method returns a jQuery collection with the positioned parent of the first matched element.

Q 24 - Which of the following jQuery method returns the top and left position of an element relative to its offset parent?

A - offset( )

B - offsetParent( )

C - position( )

D - None of the above.

Answer : C

Explaination

The position( ) method gets the top and left position of an element relative to its offset parent.

Q 25 - Which of the following jQuery method returns the outer height (including the border) of an element?

A - getCSSHeight( )

B - getHeight( )

C - outerHeight( [margin] )

D - None of the above.

Answer : C

Explaination

The outerHeight( [margin] ) method gets the outer height (includes the border and padding by default) for the first matched element.

Answer Sheet

Question Number Answer Key
1 B
2 C
3 C
4 B
5 B
6 C
7 C
8 A
9 C
10 C
11 B
12 B
13 C
14 C
15 C
16 C
17 C
18 C
19 C
20 B
21 B
22 A
23 B
24 C
25 C
jquery_questions_answers.htm

Useful Video Courses


Video

JQuery Online Training

27 Lectures 1 hours

Mahesh Kumar

Video

JQuery for Beginners

27 Lectures 1.5 hours

Pratik Singh

Video

jQuery Masterclass Course: JavaScript and AJAX Coding Bible

72 Lectures 4.5 hours

Frahaan Hussain

Video

Projects In JavaScript & JQuery

60 Lectures 9 hours

Eduonix Learning Solutions

Video

jQuery for Beginner to Advanced: 12 Projects included

17 Lectures 2 hours

Sandip Bhattacharya

Video

jQuery Memory Game Project - Fun coding Project with jQuery

12 Lectures 53 mins

Laurence Svekis

Advertisements