80 [UPDATED] JQUERY Multiple Choice Questions and Answers pdf

JQUERY Multiple Choice Questions and Answers pdf :-


****60 [MY EXPERIENCE] JQUERY Interview Questions and Answers pdf**** CLICK HERE



1) jQuery is a 
a). JavaScript Library. b).JavaScript Language c).JavaScript Method d). PHP Method
Ans: a

2. jQuery uses CSS selectors to select elements?
A. False
B. True
Ans:B

3. Which sign does jQuery use as a shortcut for jQuery?
A. the % sign
B. the ? Sign
C. the $ sign
Ans: C

4. With jQuery, look at the following selector: $("div"). What does it select?
A. All div elements
B. The first div element
Ans: A
 
5. Is jQuery a library for client scripting or server scripting?
A. Server scripting
B. Client scripting
Ans:A

6. Is it possible to use jQuery together with AJAX?
A. No
B. Yes
Ans:B

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

8. What is the correct jQuery code to set the background color of all p elements to red?
A. $("p").layout("background-color","red");
B. $("p").manipulate("background-color","red");
C. $("p").css("background-color","red");
D. $("p").style("background-color","red");
Ans:C

9. With jQuery, look at the following selector: $("div.intro"). What does it select?
A. The first div element with class="intro"
B. The first div element with id="intro"
C. All div elements with class="intro"
D. All div elements with id="intro"
Ans:C

10. Which jQuery method is used to hide selected elements?
A. hidden()
B. hide()
C. visible(false)
D. display(none)
Ans:B
JQUERY Multiple Choice interview Questions and Answers
11. Which jQuery method is used to set one or more style properties for selected elements?
A. css()
B. html()
C. style()
 Ans:A

12. Which jQuery method is used to perform an asynchronous HTTP request?
A. jQuery.ajaxAsync()
B. jQuery.ajax()
C. jQuery.ajaxSetup()
   Ans:B

13. What is the correct jQuery code for making all div elements 100 pixels high?
A. $("div").height="100"
B. $("div").height(100)
C. $("div").yPos(100)
Ans:C

14. Which statement is true?
A. To use jQuery, you must buy the jQuery library at www.jquery.com
B. 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
C. To use jQuery, you can refer to a hosted jQuery library at Google
Ans: A

15. What scripting language is jQuery written in?
A. VBScript
B. JavaScript
C. C#
D. C++
Ans: B

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

17. Which jQuery method should be used to deal with name conflicts?
A. noNameConflict()
B. noConflict()
C. nameConflict()
D. conflict()
Ans:D

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

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

20. Is jQuery a W3C standard?
A. No
B. Yes
  Ans: B

21. Which statement best explains what "unobtrusive JavaScript" is?
A. JavaScript that doesn't annoy users
B. JavaScript that is separate from HTML
C. JavaScript that does not affect a web page
D. JavaScript that works even with scripting turned off
Ans: B
22. Which of these is NOT a valid comment in JavaScript?
A. // This is a comment
B. /* This is a comment. */
C. /* This is a comment
D. .<!-- This is a comment.
Ans: C
23. How do you use JavaScript within CoffeeScript code?
A. Use the JavaScript keyword
B. Wrap the code in <script> tags
C. Wrap the code in backticks or grave accents [`]
D. You can't embed JavaScript code within CoffeeScript
Ans: C
24. In JavaScript, we can keep a reference to the context outside a function by assigning it to a variable: var self = this. In CoffeeScript, we use:

A. self = this printScope -> console.log self
B. printScope => console.log @
C. printScope => console.log this
D. All of the above
Ans: D
25. What is the correct JavaScript syntax to write "Hello World"?
A. document.write("Hello World")
B. ("Hello World")
C. response.write("Hello World")
D. "Hello World"
Ans: A

26. jQuery is a...
A. JavaScript library
B. Ruby Gem
C. PHP Framework
D. None of the above
Ans: A
27. jQuery's main focus is..
A. AJAX
B. DOM Manipulation
C. Animations
D. All of the above
Ans: D
28. $.foo() is equivalent to..
A. javascript.foo()
B. document.foo()
C. jQuery.foo()
D. None of the above
Ans: C

29. Can jQuery be used on the same page alongside other libraries?
A. Yes
B. No
Ans: A

30. var ps = $("p");
ps will be..
A. A linked list
B. A hash or dictionary
C. An array
D. A jQuery object
Ans: D

31. $(document).ready(function() {
// Some code.
});
The above code is used to..
A. Make sure no code is executed till the entire page is fully loaded
B. Make sure no code is executed till the DOM is fully loaded
C. Both A and B
D. Neither A nor B
Ans: B

32. Can you can use CSS3 selectors to select or find elements using jQuery?
A. Yes
B. No
Ans: A

33. You can test whether the browser supports specific features using...
A. $.support
B. $.browser
C. $.featureTest
D. $.browserTest
Ans: A

34. Multiple document.ready blocks can be placed in a page without detriments. This statement is..
A. True
B. False
Ans: A

35. Query.noConflict(true) is used to..
A. Free up the $ symbol for use by other libraries
B. Improve compatibility
C. Remove all jQuery variables from the global scope
D. All of the above
Ans: D

36. $('p').click(function(){
// Code here
});
Inside the commented section, the value of the variable this is a..
A. Array
B. String
C. Reference to the DOM node
D. jQuery object
Ans: C

37. The method that provides AJAX functionality within jQuery is named..
A. ajax
B. easyAJAX
C. jQueryajax
D. jQajax
Ans: A
38. The CSS selector engine that jQuery uses is called?
A. Badaboom
B. Mango
C. Sizzle
D. AwesomeX
Ans: C

39. You can attach a handler to an event using which method?
A. eventBind
B. bind
C. attach
D. eventAttach
Ans: B

40. $('#masterList').find('li')
.width(500).addClass('selected');
The phenomena occuring in the above code is called?
A. Chaining
B. Event bubbling
C. AJAX
D. Animating
Ans: A

41.  What is jQuery?
a) jQuery is a library of JavaScript Functions.
b) jQuery stands for Structured Query Language
c) jQuery stands for Cascading Style Sheets.
d) jQuery communication between computers on the Internet.
Ans: A
42) The jQuery library contains the following features
a)  HTML element selections. HTML element manipulation .HTML event functions
b)  CSS manipulation. JavaScript Effects and animations. HTML DOM traversal and modification
c)  JavaScript Effects and animations. HTML DOM traversal and modification. AJAX. Utilities
d)  all of the above
Ans:D
43) AJAX and jQuery
a) jQuery provides a rich set of methods (functions) for AJAX web development.
b) With jQuery AJAX, you can request TXT, HTML, XML or JSON data from a remote server using both HTTP Get and HTTP Post.
c) a and b
d) AJAX and jQuery are cross-platform (you can develop in Windows and serve on a Unix platform)
Ans: C

44) Load remote data using HTTP GET
a) $.get(url,data,callback,type)
b) $.ajax(options)
c) $.post(url,data,callback,type)
d) $.getScript(url,callback)
Ans: A

45) Triggers, or binds a function to the error event of selected elements.
a) click()
b) error()
c) event.pageX
d) click.error()
Ans: B

46. What are the :odd and :even filters?
a) They allow you to determine if a number is odd or even.
b) They  allow you to determine if a specific element is in an odd or even position.
c) None of the above.
Ans: B
47. When referencing an HTML element preceded by a # (pound or hash), what javascript function is this equivalent to?
a) getElementById
b) getElementByClassName
c) getElementByTagName
d) None of the above
Ans: A

48. When referencing an HTML element preceded by a . (dot), what javascript function is this equivalent to?
a) getElementById
b) getElementByClassName
c) getElementByTagName
d) None of the above
Ans: D

49. What is the each function used for?
a) The Each function allows you to loop though every element in a parent element.
b) The Each function allows you to put the word "Each" into each element
c) The Each function allows you to loop through different elements with a class or ID.
d) None of the above.
Ans: C

50. What is the difference between Hover and Mouseover
a) Mouseover allows you to specify an optional function to use for the mouseout event
b) Hover allows you to specify an optional function to use for the mouseout event
c) No Difference; Mouseover and Hover are the same
Ans: B

51. What are the various speed options?
a) The words "slow" and "fast" as well as integers for the milliseconds
b) Only the words "slow", "fast", and "medium"
c) All of the above
d) None of the above
Ans: A

52. The speed options can be applied to which jQuery functions?
a) css and ajax
b) show and fadeIn
c) toggleCss
d) All of the above
Ans: B

53. If you want to stop your jQuery for a few milliseconds, which function do you use?
a) stop()
b) pause()
c) slowdown()
d) delay()
Ans: D

54. Which function do you reference in HTML form data?
a) value()
b) formData()
c) val()
d) None of the above
Ans: C

55. When do you use the $(this) code?
a) When an HTML element will reference its own action.
b) When an HTML element will reference its parent element's action
c) When an HTML element will reference the entire document
d) None of the above.
Ans: A

56. What does the function $(“.selector”) return?
a) An array.
b) A node list.
c) A new jQuery object.
Ans: C

57.  Why do we usually add the stop() method before calling animate()?
a) stop() halts the execution of the scripts on the page until the animation has finished.
b) stop() ends any currently running animations on the element, and prevents conflicts and pile-ups.
c) We tell jQuery that the animation has to be stopped at some point.
Ans: B

58. What is the difference between .width() and .outerWidth()?
a) The methods are basically the same. The only difference is that .width() returns a number, whereas outerWidth() a string.
b) width() returns the computed width of the element, while outerWidth() returns the width plus all the margins and paddings.
c) No difference. width() is a shorthand alias for outerWidth()
Ans: B

59. How do you fetch the first span on the page, which has the class ‘green’?
a) $('span, .green, :first')
b) $('first .green span')
c) $('span.green:first')
Ans: C

60. What does the $('#myDiv').hover() method do?
a) It binds the functions you pass as parameters, to the mouseenter and mouseleave events.
b) Converts the element upon which it was called, into a hoverable menu.

Ans: A

61. Which of the following is correct?
A. jQuery is a JavaScript Library
B. jQuery is a JSON Library
Ans: A

62).jQuery is
a).Light weight b).Interpreter compiled c).parallelly processed d).Runs in js shell

63).jQuery does not support which of the following
a).HTML/DOM Manipulation b).HTML events c).AJAX d).PHP Bytecode

64).Minified and compressed version of jQuery is usually used as
a).Development version b).Production version c).Beta Version d).Alpha version

65).$(selector).action() – What does this jquery syntax format do?
a).Select an HTML element and then use HTML to act on it
b).Select an HTML element and perform some actin on it
c).Perform an action on an element and then select it
d).Perform selection and ignore the action

66).What does the dollar sign in jQuery statement do?
a).It loads the jQuery methods b).It loads the DOM c).It loads PHP d).It is used to define or access jQuery

67).Here is a jquery code:
$(document).ready(function(){});
Why do we place all jQuery methods inside this code?
a).Because jQuery is never compiled b).It shows where jQuery starts and ends
c).To enable the DOM to load jQuery d).To prevent jQuery code from running before the document is fully loaded

68).$(function(){});
What does this piece of jQuery do?
a).This is a shorter version for $(document).ready(function(){});
b).This is to test if jQuery can be loaded again
c).This is to test if jQuery has completed execution
d).This is to create a method in jQuery

69).$(‘#temp’).action()
What type of selector is used in the above jQuery syntax?
a).id selector
b).class selector
c).name selector
d).value selector

70).Which of the following jQuery syntax uses the class selector
a).$(‘#temp’) b).$(‘.temp’) c).$(‘class’) d).$(‘temp’).class

Important JQuery Questions that can be asked in Top Companies :-


71).Give the syntax for selecting the current HTML element.
72).How do we select odd tr elements.
73).How do we write a click event that gets fired on a paragraph element.
74).We have mouse events, key board events etc. So Submit, Focus,Change etc are examples of what type of events?
75).Explain the syntax for hiding a paragraph element.
76).$(“#div_alpha”).fadeIn(1000); what does this mean?
77).Give the jQuery method name to create custom animations.
78).text() – Sets or returns the text content of selected elements – Is this true?
79).$(“#div_beta”).html(“Hello“); What is the error in this piece of code?
80).$(“p”).append(“append me at the end.”); What is the output of this jQuery?

60 [UPDATED] JQUERY Interview Questions and Answers pdf

JQUERY Interview Questions and Answers pdf :-


1. What is Jquery?


2. When Jquery founded and by whom?


3. What scripting language is jQuery written in?


4. Write a basic code for add jquery library to pages?


5. What is jQuery Selectors? Give some examples.


6.  What $("div.dotnet") will select?


7. JQuery uses CSS selectors and XPath expressions to select elements true or false?


8. What are the fastest selectors in Jquery?
 

9. What are the slower selecoters in Jquery?


10. Which one is faster Jquery ID selector or JavaScript getElementById()?
JQUERY Interview Questions and Answers
JQUERY Interview Questions and Answers
11. Where Jquery code execute? On client browser or server browser?


12. Write the code for selecting the


13. Write the code for select second last div element?


14. What are the advantages of using jQuery over JavaScript in ASP.NET web application


15. What is Chaining in jQuery?


16. Is jQuery a library for client scripting or server scripting?
 

17. What is jQuery & its significance? Why it is so popular?


18. What are features of JQuery


19. How to check Jquery UI loaded or not?


20. How check currently loaded jQuery UI version on the page?


21. Write the code for setting datetimepicker on textbox click.


22. If you have a table, how you will apply the two differt color on alternate rows using Jquery?


23. Name the Jquery method which is used to hide selected elements?


24. Name the Jquery methods which are used for apply css class?


25. What is the use of attr() method in Jquery?


26. Can we use both jQuery and AJAX together?


27. Tell the name of jQuery method which is used to perform an asynchronous HTTP request?


28. What is the use of jquery load() method?


29. Can we use our own specific charactor in the place of $ sigh in Jquery?


30. Name the 5 Jquery events?

Name the 5 Jquery events?


  1.  jQuery Events
  2.  jQuery click() event.
  3.  jQuery dblclick() event.
  4.  jQuery mouseenter() event.
  5.  jQuery mouseleave() event.
  6.  jQuery mousedown() event.
  7.  jQuery mouseup() event.
  8.  jQuery hover() event.
  9.  jQuery focus() and blur() events.

Can we use our own specific charactor in the place of $ sigh in Jquery?

ANS :- Yes
You can also create your own shortcut very easily. The noConflict() method returns a reference to jQuery, that you can save in a variable, for later use. Here is an example
    var kk= $.noConflict();

     kk(document).ready(function () {
         kk("button").click(function () {
             kk("p").text("jQuery is still working!");
         });
     });

What is the use of jquery load() method?

ANS :- The jQuery load() method is a powerful AJAX method.
 The load() method loads data from a server and puts the returned data into the selected element without reload the complate page.
 Ex:The following example loads the content of the file "demo_test.txt" into a specific <div> element
$("#div1").load("demo_test.txt"); 

Tell the name of jQuery method which is used to perform an asynchronous HTTP request?

ANS :- jQuery.ajax()

Can we use both jQuery and AJAX together?

ANS :- yes

What is the use of attr() method in Jquery?

ANS :- The attr() method sets or returns attributes and values of the selected elements.
 When this method is used to return the attribute value, it returns the value of the first matched element.
 When this method is used to set attribute values, it sets one or more attribute/value pairs for the set of matched elements.
$(selector).attr(attribute) //it will return the value of an attribute
 $(selector).attr(attribute,value) //it will set the value of an attribute
 $(selector).attr({attribute:value, attribute:value,...}) //for set multiple attribute

Name the Jquery methods which are used for apply css class?

$("#Id1").addClass('YourClassName'); // for apply class
$("#Id1").removeClass('YourClassName'); // for remove class

Name the Jquery method which is used to hide selected elements?

ANS :- .hide()

If you have a table, how you will apply the two differt color on alternate rows using Jquery?

<table border="1">   <tr><td>kk</td></tr>
   <tr><td>SB</td></tr>
   <tr><td>Avi</td></tr>
   <tr><td>SN</td></tr>
</table>
  Ans :
<script>

     $(document).ready(function () {
         $("tr:even").css("background-color", "#f4f4f8");
         $("tr:odd").css("background-color", "#ffffff");
     });
 </script>

Write the code for setting datetimepicker on textbox click.

If below is our textbox
<input type="text" id="Text1" name=%26quot%3Bacc%26quot%3B value="Select Date" />  then Jquery code will be
$("#abc").datepicker();

How check currently loaded jQuery UI version on the page?

// Returns jQuery UI version (ex: 1.8.2) or undefined
 $.ui.version

How to check Jquery UI loaded or not?

 // Checking if jQuery UI is loaded or not
        if ($.ui) {

             // jQuery UI is loaded
         } else {
             // jQuery UI is not loaded
         } 

What are Features of JQuery

Features of Jquery

 1. One can easily provide effects and can do animations.
 2. Applying / Changing CSS.
 3. Cool plugins.
 4. Ajax support
 5. DOM selection events
 6. Event Handling

What is jQuery & its significance? Why it is so popular?

jQuery is lightweight, client side script JavaScript library file that supports all browsers.Query is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery makes it easy to play with the DOM, add effects, and execute Ajax requests.

This helps developer to reduce lines of code while he program. For example huge code written in Java Script, can be done easily with JQuery in one or two lines as it uses pre compiled JavaScript library internally. For example To find a Div that have class xxx we can do this using custom JavaScript by looping through all DOM elements, Find Div element write if statement checking the class then write the code to manipulate cross browser.  But this can be achieved using jQuery with 2 lines of code. jQuery is a fun library to use and play.

It is so popular due to the below 10 reasons.

  • Cross Browser Compatibility.
  • Fast but micro Famework.The jQuery core library minified is only about 24KB in size, so it is very easily to include in any application and it is pretty fast as well.
  • Easy to learn and flexible.
  • It is well documented.
  • Reuse of plug-ins across projects .These plug ins are extendable.
  • Latest CSS Complaint.
  • Microsoft, which now includes jQuery with its MVC framework and integrated to VS2010 with intellisense support .
  • IBM, Netflix use jQuery. Nokia have adopted it. Google uses and hosts the jQuery library.
  • Easy to find support since there is a large development community and variety of plug-ins.
  • DOM manipulation with querying and chaining is Wonderful & Robust. It is simple, concise and clear enough.

Hence jQuery is definitely faster, easier and more productive than previous traditional JavaScript that we use, hence its so popular.

Now the Client side development is fun using jQuery Agree or not ??

Is jQuery a library for client scripting or server scripting?

ANS :- Client Script

What is Chaining in jQuery?

In jQuery, Chaining means to connect multiple functions, events on selectors. look at Sample Code 1 and 2.

$(document).ready(function(){
     $('#dvContent').addClass('dummy');
     $('#dvContent').css('color', 'red');
     $('#dvContent').fadeIn('slow');
 });​

$(document).ready(function(){

     $('#dvContent').addClass('dummy')
           .css('color', 'red')
           .fadeIn('slow');  
 });​

Both the sample codes above will perform the exact same thing but the only difference is that Sample code 2 is using Chaining. But Code 2 is faster and shorter then Code 1.

The problem with the Sample Code 1 is that for every statement, jQuery has to search the entire DOM and find the element and after that executes the attached function on it. But when chaining is used, then jQuery has to find the element only once and it will execute all the attached functions one by one. This is the advantage of Chaining.

What are the advantages of using jQuery over JavaScript in ASP.NET web application

ANS :- Below are the advatages of using jQery over JavaScript

 a. Jquery is well written optimised javascript code so
 it will be faster in execution unless we write same standard optimised javascript code.
 b. Jquery is concise java script code ,means minimal ammount of code
 is to be written for the same functionality than the javascript.
 c. Javascript related Development is fast using Jquery because most of the
 functionality is already written in the library and we just need to use that.
 d. Jquery has cross browser support ,so we save time for supporting all the browsers.

Write the code for select second last div element?

ANS :- Code for second last div : $("div.questions > div::nth-last-child(2)").css("color", "green");
 <!-- Introduced in CSS3 -->

Write the code for selecting the

1st div element, 4th div element
 last div, and for even and odd div elemets also.
 one by one?
 apply the red color on the above div.


<div class="questions">
     <div class="box"> Question</div>
     <div class="box"> Question</div>
     <div class="box"> Question</div>
     <div class="box"> Question</div>
     <div class="box"> Question</div>
     <div class="box"> Question</div>
</div>
 Code for first div          : $("div.questions > div:first").css("color", "green");
 Code for 4th div          : $("div.questions > div:nth-child(4)").css("color", "green");
 Code for last div          : $("div.questions > div:last").css("color", "green");
 Code for even div        : $("div.questions > div:even").css("color", "green");
 Code for odd div         : $("div.questions > div:odd").css("color", "green");

Where Jquery code execute? On client browser or server browser?

Which one is faster Jquery ID selector or JavaScript getElementById()?

ANS :- (Jquery ID selector vs JavaScript getElementById())

JavaScript getElementById() is faster than Jquery Id ($("#elementID")) selector

What are the slower selecoters in Jquery?

ANS :- Class selectors are slower

What are the fastest selectors in Jquery?

ANS :- ID and element selectors are the fastest selectors

JQuery uses CSS selectors and XPath expressions to select elements true or false?

ANS :- True

What $("div.dotnet") will select?

All the div element with dotnet class.

What is jQuery Selectors? Give some examples

Selectors are used in jQuery to find out DOM elements. Selectors can find the elements via ID, CSS, Element name and hierarchical position of the element.

Selector       Example                 Selects

 *                 $("*")                    All elements
 #id              $("#lastname")        The element with id=lastname
 .class           $(".intro")               All elements with class="intro"
 element        $("p")                     All p elements

Write a basic code for add jquery library to pages?

<html>
<head>
  <script type="text/javascript" src="jquery.js"></script>
  <script type="text/javascript">
      // You can write the code here
  </script>
</head>
<body>
    <a href="http://www.dotnet360.in/">Jquery Interview Questions and  Answers</a>
</body>
</html>

What scripting language is jQuery written in?

JavaScript language is jQuery

When Jquery founded and by whom?

It was released in January 2006 at BarCamp NYC by John Resig(Jquery founder).

What is Jquery?

ANS :- jquery is javascript library which required a jquery.js file. After that you can write the jquery as fallows. It uses "$" as the short hand to write jquery code.

Syntax:
  $(document).ready(function () {

         //function body
     });