jQuery Quiz- 2 with answers


1. Which of the following is correct?
jQuery is a JavaScript Library
jQuery is a JSON Library

2. jQuery uses CSS selectors and XPath expressions to select elements?
False
True

3. Which sign does jQuery use as a shortcut for jQuery?
the % sign
the ? Sign
the $ sign

4. With jQuery, look at the following selector: $(“div”). What does it select?
The first div element
All div elements

5. Is jQuery a library for client scripting or server scripting?
Client scripting
Server scripting

6. Is it possible to use jQuery together with AJAX?
Yes
No

7. The jQuery html() method works for both HTML and XML documents
False
True

8. What is the correct jQuery code to set the background color of all p elements to red?
$(“p”).style(“background-color”,”red”);
$(“p”).layout(“background-color”,”red”);
$(“p”).css(“background-color”,”red”);
$(“p”).manipulate(“background-color”,”red”);

9.With jQuery, look at the following selector: $(“div.intro”). What does it select?
All div elements with class=”intro”
The first div element with id=”intro”
The first div element with class=”intro”
All div elements with id=”intro”

10. Which jQuery method is used to hide selected elements?
hidden()
hide()
display(none)
visible(false)

11. Which jQuery method is used to set one or more style properties for selected elements?
css()
style()
html()

12. Which jQuery method is used to perform an asynchronous HTTP request?
jQuery.ajaxSetup()
jQuery.ajax()
jQuery.ajaxAsync()

13. What is the correct jQuery code for making all div elements 100 pixels high?
$(“div”).yPos(100)
$(“div”).height(100)
$(“div”).height=”100″

14. Which statement is true?
To use jQuery, you do not have to do anything. Most browsers (Internet Explorer, Chrome, Firefox and                 Opera) have the jQuery library built in the browser
To use jQuery, you must buy the jQuery library at http://www.jquery.com
To use jQuery, you can refer to a hosted jQuery library at Google

15. What scripting language is jQuery written in?
VBScript
JavaScript
C++
C#

16. Which jQuery function is used to prevent code from running, before the document is finished loading?
$(document).load()
$(document).ready()
$(body).onload()

17. Which jQuery method should be used to deal with name conflicts?
noConflict()
nameConflict()
conflict()
noNameConflict()

18. Which jQuery method is used to switch between adding/removing one or more classes (for CSS) from selected elements?
switchClass()
toggleClass()
switch()
altClass()

19. Look at the following jQuery selector: $(“div#intro .head”). What does it select?
The first element with id=”head” inside any div element with class=”intro”
All elements with class=”head” inside the first div element with id=”intro”
All div elements with id=”intro” or class=”head”

20. Is jQuery a W3C standard?
No
Yes

Advertisements

4 thoughts on “jQuery Quiz- 2 with answers

  1. 9.With jQuery, look at the following selector: $(“div.intro”). What does it select?
    i think the answer will be All div elements with class=”intro” because . means it will refer to class name

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s