jQuery Online Test Questions part 2

7. JQuery does not have DOM traversing capability.

a. True
b. False

Answer: b. False

Explanation: The above statement is false. JQuery have DOM traversing capability.
JQuery is a very powerful tool which provides a variety of DOM traversal methods to help us select elements in a document randomly as well as in sequential method.


8. .css("width") and .width() are the two ways to change the width of _________.

a. selector
b. element
c. fade effect
d. radio button

Answer: b. element

Explanation: .css("width") and .width() are the two ways to change the width of element.


9. It is compulsory to add jquery file both at master page and content page.

a. True
b. False

Answer: b. False

Explanation: The above statement is false. No Need to add JQuery files on both at master page and content page. If we will apply on master page it will consider for all of the pages.


10. The ________ method works for accepting an array of DOM elements and pushes them into a stack.

a. push()
b. pop()
c. pushStack()
d. popStack()

Answer: c. pushStack()

Explanation: The pushStack() method works for accepting an array of DOM elements and pushes them into a stack. It adds a collection of DOM elements onto the jQuery stack.


11. The _______ Method acts as explicit iterator.

a. .hover()
b. .all()
c. .toggle()
d. .each()

Answer: d. .each()

Explanation: The .each() Method acts as explicit iterator. This method can be employed when the code we want to use on each of the matched elements is too complex for the implicit iteration syntax.


12. How many ways are there to check or unchecked the radio button?

a. One
b. Two
c. Three
d. Four

Answer: b. Two

Explanation: There are two ways to check or unchecked the radio button,
1) .prop()
2) .attr()