Olete.in
Articles
Mock Tests
🧪 Jquery MCQ Quiz Hub
Jquery Mcq Set 1
Choose a topic to test your knowledge and improve your Jquery skills
1. Who developed jQuery, and in which year it was first released?
John Richard in 2001
Mark Bensman in 2004
John Resig in 2006
none of the above
2. jQuery is a -
JavaScript method
JavaScript library
JSON library
PHP method
3. Which of the following sign is used as a shortcut for jQuery?
the % sign
the & sign
the $ sign
the @ sign
4. $(this) in jQuery is used when -
an HTML element references the entire document
an HTML element references its own action
an HTML element references the action of its parent element
All of the above
5. Which of the following jQuery method is used to hide the selected elements?
The hidden() method
The hide() method
The visible(false) method
The display(none) method
6. Which jQuery method is used to set one or more style properties to the selected element?
The html() method
The style() method
The css() method
All of the above
7. Which of the following jQuery method can be used to deal with the name conflicts?
The conflict() method
The nameConflict() method
The noConflict() method
none of the above
8. The correct syntax to set the background color of all h1 elements to yellow in jQuery -
$("h1").style("background-color","yellow");
$("h1").html("background-color","yellow");
$("h1").css("background-color","yellow");
$("h1").layout("background-color","yellow");
9. Which of the following jQuery method is used to attach a handler to an event?
unbind() method
attach() method
bind() method
none of the above
10. The jQuery method used to perform an asynchronous HTTP request -
jQuery ajaxSetup() method
jQuery ajaxSync() method
jQuery ajax() method
none of the above
11. Which of the following jQuery method is used to stop jQuery for few milliseconds?
stop() method
delay() method
slowdown() method
pause() method
12. What does the syntax $("p.para") will select?
The first paragraph element with class = "para"
The first paragraph element with id = "para"
The first paragraph element with name = "para"
All paragraph elements with class = "para"
13. Which of the jQuery function prevents the code from running before the loading of the document finishes?
$(document).load()
$(document).unload()
$(document).ready()
$(document).trim()
14. The jQuery used to find all next sibling elements after the current element is -
find() method
nextAll() method
siblings() method
none of the above
15. The correct syntax for selecting the first paragraph element with id p1 is -
$("p.p1:first")
$("p#p1:first")
$("p1#p:first")
none of the above
16. Which of the following jQuery method is used to check whether or not the selected elements have the specified class name?
hasClass() method
addClass() method
find() method
toggleClass() method
17. Which of the following jQuery method is used to set the value of an element?
val() method
setValue() method
content() method
none of the above
18. The jQuery method used to set the width property of an element is -
setWidth( val ) method
width( val ) method
setCSSWidth( val ) method
none of the above
19. The jQuery method used to get all ancestors of the matched set of elements is -
parents() method
parent() method
offsetParent() method
none of the above
20. The jQuery method used to remove the set of matched elements is -
delete() method
empty() method
remove() method
none of the above
21. The jQuery method used for parsing the JSON text is -
parseJSON() method
parseHTML() method
noConflict() method
each() method
22. What does the syntax $("div#myDiv .para") will select?
It will select all elements with class = "para" within the div element with id = "myDiv"
It will select all elements with id = "myDiv" within the div element with class = "para"
All div elements with class = "para" or with id = "myDiv"
none of the above
23. Which of the following jQuery method is used to reduce the set of matched elements to a single element?
isEqual() method
val() method
eq() method
delegate() method
24. The toggle() method in jQuery is used to -
toggle between the hide() and show() methods
toggle between the fadeIn() and fadeOut() methods
toggle between the slideUp() and slideDown() methods
none of the above
25. Which of the following method is used to toggle between the fadeIn() method and fadeOut() method?
toggle() method
fadeToggle() method
slideToggle() method
animate() method
26. The :even and :odd filters in jQuery are used to -
determine if the number is odd or even
determine if the index position of an element is odd or even
both (a) & (b)
none of the above
27. If the names of variables are the same, then which of the following type of variable takes precedence?
local variable
global variable
both (a) & (b)
none of the above
28. Which of the following is the correct code in jQuery to make all div elements 150px high?
$("div").height(150);
$("div").height = "150" ;
$("div").height = 150 ;
none of the above
29. CDN stands for -
Content development network
Content delivery network / Content distribution network
Communication development network
none of the above
30. Which of the following is the basic requirement to start with jQuery?
To use jQuery, first, we have to buy the jQuery library from its official website.
To use jQuery, we don't require anything as it is already built in the browser we are using.
To use jQuery, we have to refer to its hosted library, or we can download the latest jQuery version from its official website.
All of the above
31. The jQuery method used to find all previous sibling elements of the current element is -
nextAll() method
prevAll() method
siblings() method
none of the above
32. The jQuery method used to return the direct parent element of the selected element is -
parents() method
parent() method
offsetParent() method
none of the above
33. The jQuery method used to load data using HTTP get is -
get(URL, data, callback, dataType) method
post(URL, data, callback, dataType) method
ajax() method
ajaxSend() method
34. Can we use multiple document.ready() function on the same page?
Yes
No
Can't say
Not possible
35. The code $("p").css("background-color","yellow") is equivalent to -
jQuery("p").css("background-color","yellow")
document("p").css("background-color","yellow")
jq("p").css("background-color","yellow")
none of the above
36. Which of the following jQuery method is used to add/remove one or more classes from the selected elements?
toggleClass() method
fadeToggle() method
toggle() method
slideToggle() method
37. What does the syntax $("p") will select?
All paragraph elements
Only first paragraph element
Only last paragraph element
none of the above
38. What does the syntax $("p span") will select?
All span elements inside the paragraph element
Only first span element inside the paragraph element
Only last span element inside the paragraph element
none of the above
39. The selector $(":disabled") will select -
The elements with the text ":disabled"
The elements that do not include the text ":disabled"
The hidden elements
All disabled input elements
40. Which of the following selector in jQuery is used to select the elements with lesser index value than the value of its index parameter?
jQuery :lt() selector
jQuery :gt() selector
jQuery :lang() selector
jQuery :nth-child selector
41. Which of the following method in jQuery is used to make copies of the set of matched elements?
jQuery detach() method
jQuery delegate() method
jQuery clone() method
jQuery serialize() method
42. The jQuery method which is used to remove the tabs, space and the line breaks from the beginning and end of the specified string is -
jQuery empty() method
jQuery trim() method
jQuery remove() method
jQuery serialize() method
43. Which of the following jQuery method returns the direct children of the selected element?
jQuery ancestors() method
jQuery next() method
jQuery children() method
none of the above
44. Which of the following jQuery method returns all siblings of the selected element?
jQuery ancestors() method
jQuery siblings() method
jQuery parents() method
none of the above
45. The jQuery selector used to select the elements containing the specified string is -
jQuery :contains selector
jQuery :lang() selector
jQuery :nth-child selector
none of the above
46. The jQuery selector used to select the elements with the specified language code is -
jQuery :contains selector
jQuery :lang() selector
jQuery :nth-child selector
none of the above
47. Which of the following jQuery method is used to replace all selected elements with new HTML elements?
jQuery replaceWith() method
jQuery replaceAll() method
jQuery load() method
jQuery delegate() method
48. The jQuery method used to trigger a specified event handler for the selected element is -
jQuery trigger() method
jQuery toggle() method
jQuery eq() method
jQuery next() method
49. Which of the following method is used to remove the specified attribute from the selected element?
jQuery remove() method
jQuery empty() method
jQuery removeAttr() method
jQuery error() method
50. Which of the following jQuery method is used to merge the content of two or more objects into the first object?
jQuery extend() method
jQuery eq() method
jQuery data() method
jQuery param() method
Submit