1. jQuery is a
a) JSON libraryanswer : c
Description : jQuery is a fast, small, cross-platform, and feature-rich JavaScript library.
2. which jquery method is used to hide selected elements?
a) hide() Methodanswer : a
Description : The hide() method hides the selected elements.
3. jQuery uses ________ syntax to select elements
a) CSSanswer : a
Description : jQuery uses CSS syntax to select elements.
4. Which sign does jquery use as a shortcut for jquery?
a) & signanswer : d
Description : $ sign is used as a shortcut for jQuery. Every jQuery selector starts with this dollar sign $().
5. Which jquery method is used to remove selected elements?
a) detach()answer : a
Description : The detach() method removes the selected elements
6. what is the correct jquery code to set the background color of all p elements to red?
a) $("p").display("background-color","red");answer : b
Description : $("p").css("background-color","red"); is jquery code to set the background color of all p elements to red.
7. which jquery method returns the direct parent element of the selected element?
a) upperdiv() Methodanswer : b
Description : The parent() method returns the direct parent element of the selected element.
8. with jquery, look at the following selector: $("div.intro"). what does it select?
a) All div elements with class="intro"answer : a
Description : All div elements with class="intro"
9. The jQuery html() method works for both HTML and XML documents
a) Trueanswer : b
Description : JQuery HTML doesn’t work with XML document. It only works for HTML documents
10. which jquery method is used to set one or more style properties for selected elements?
a) css()answer : a
Description : css() method is used to set one or more style properties for selected elements in jquery
11. which jquery method should be used to deal with name conflicts?
a) The nameConflict() methodanswer : b
Description : The noConflict() Method should be used to deal with name conflicts. Javascript has many other frameworks which used $ sign. in case you use both jquery and other frameworks on the same page conflict will occur. To avoid this use noConflict() Method
12. when was jquery first released?
a) 2006answer : a
Description : jquery first released in 2006
13. Which jQuery method is used to attach multiple event handlers to an element?
a) attach() methodanswer : c
Description : The on() method attaches one or more event handlers for the selected elements and child elements.
14. Which of the jQuery function prevents the code from running before the loading of the document finishes?
a) $(document).ready()answer : a
Description : $(document).ready() is to prevent any jQuery code from running before the document is finished loading.
15. What does the syntax $("p") will select?
a) Only first paragraph elementanswer : b
Description : it will select All paragraph elements
16. Which of the following is a single global function defined in the jQuery library?
a) jQuery()answer : a
Description : jQuery()
17. Look at the following selector: $("div"). What does it select?
a) All div elementanswer : a
Description : it will select All div element.
18. Which code will hide the current element?
a) $("p").hide()answer : b
Description : $(this).hide()
19. jQuery is a ___________.
a) lightweightanswer : a
Description : jQuery is a lightweight, "write less, do more", JavaScript library
20. $(this) in jQuery is used when
a) an HTML element references the action of its parentanswer : c
Description : an HTML element references its own action. $(this) represents a reference to the object that invoked the current function.