100+ JQuery CCEE MCQ
100+ JQuery CCEE MCQ
Sr.No
Project Name YouTube Link
11 Tour and Travel System Project version 3.0 https://youtu.be/Dm7nOdpasWg?si=P_Lh2gcOFhlyudug
12 Gym Management system Project https://youtu.be/J8_7Zrkg7ag?si=LcxV51ynfUB7OptX
13 Online Driving License system Project https://youtu.be/3yRzsMs8TLE?si=JRI_z4FDx4Gmt7fn
14 Online Flight Booking system Project https://youtu.be/m755rOwdk8U?si=HURvAY2VnizIyJlh
15 Employee management system project https://youtu.be/lD1iE3W_GRw?si=Y_jv1xV_BljhrD0H
16 Online student school or college portal https://youtu.be/4A25aEKfei0?si=RoVgZtxMk9TPdQvD
17 Online movie booking system project https://youtu.be/Lfjv_U74SC4?si=fiDvrhhrjb4KSlSm
18 Online Pizza Delivery system project https://youtu.be/Tp3izreZ458?si=8eWAOzA8SVdNwlyM
19 Online Crime Reporting system Project https://youtu.be/0UlzReSk9tQ?si=6vN0e70TVY1GOwPO
20 Online Children Adoption Project https://youtu.be/3T5HC2HKyT4?si=bntP78niYH802I7N
pg. 4 contact us on 8007592194 / 9284926333 www.codewitharrays.in
jQuery Multiple-Choice Questions (MCQs)
jQuery is a JavaScript library designed to simplify HTML DOM tree traversal and manipulation, as well
as event handling, CSS animation, and Ajax. It is free, open-source software using the permissive MIT
License.
jQuery MCQs: This section contains jQuery Multiple-Choice Questions with Answers. These jQuery
MCQs are written for beginners as well as advanced, practice these MCQs to enhance and test the
knowledge of jQuery.
A. JavaScript Library
B. JSON Library
4
C. Java Library
9
D. JSON and CSS Library
21
Answer: A) JavaScript Library
59
07
Explanation:
80
2. To work with jQuery, you should have the basic knowledge of these topics?
ith
A. HTML
w
B. CSS
de
C. JavaScript
co
Explanation:
To work with jQuery, you should have the basic knowledge of HTML, CSS, and JavaScript.
A. John Richard
B. John Resig
C. John Carter
D. John Alexander
Answer: B) John Resig
Explanation:
A. 2004
B. 2005
C. 2006
D. 2007
Answer: C) 2006
49
Explanation:
21
jQuery was initial released on August 26, 2006.
59
07
Discuss this Question
80
.in
5. Is jQuery case-sensitive?
ys
A. Yes
ra
B. No
ar
Answer: A) Yes
ith
w
Explanation:
de
A. HTML/DOM manipulation
B. CSS manipulation
C. HTML event methods
D. Effects and animations
E. AJAX
F. Utilities
G. All of the above
A. $
B. .
C. &
D. #
Answer: A) $
Explanation:
9 4
$ sign is used to define/access jQuery.
21
59
Discuss this Question
07
80
A. $(this).hideelement()
B. $(this).hide('true')
ys
C. $(this).hide(0)
ra
D. $(this).hide()
ar
ith
Answer: D) $(this).hide()
w
Explanation:
de
A. $("div").hide()
B. $(div).hide()
C. $(".div").hide()
D. $("#div").hide()
Answer: A) $("div").hide()
Explanation:
10. Which is the correct jQuery statement to hide all elements having class name "new"?
A. $("new").hide()
B. $(new).hide()
C. $(".new").hide()
D. $("#new").hide()
Answer: C) $(".new").hide()
Explanation:
The $(".new").hide() statement can be used to hide all elements having class name "new".
9 4
21
11. Which is the correct jQuery statement to hide all elements having id name "new"?
A. $("new").hide()
59
07
B. $(new).hide()
80
C. $(".new").hide()
D. $("#new").hide()
.in
ys
Answer: D) $("#new").hide()
ra
Explanation:
ar
ith
The $("#new").hide() statement can be used to hide all elements having id name "new".
w
Answer: A) jQuery selectors are used to select and manipulate HTML element(s)
Explanation:
A. $(".div")
B. $("#div")
C. $("div")
D. $("<div>")
Answer: C) $("div")
Explanation:
The statement $("div") is the correct syntax to select all <div> elements.
94
A. $class
21
B. .class
C. #class
59
D. None 07
Answer: C) .class
80
Explanation:
.in
ys
The dot sign (.) i.e., .class is used for the class selector.
ra
A. $id
co
B. .id
C. #id
D. None
Answer: C) #id
Explanation:
Explanation:
The #id selectors are used to select all elements having the id.
A. $("all")
B. $("*.*")
C. $("*")
4
9
D. $("***")
21
Answer: C) $("*")
59
07
Explanation:
80
18. Which is the correct jQuery selector to select current HTML element?
ith
A. $(this)
w
B. $(cur)
de
C. $(.this)
co
D. $(#this)
Answer: A) $(this)
Explanation:
19. Which is the correct jQuery selector to select all <div> elements with class name "new"?
A. $(".new")
B. $("div.new")
C. $(".div.new")
D. $(".div#new")
Answer: B) $("div.new")
Explanation:
The $("div.new") selector is used to select all <div> elements with class name "new".
20. Which is the correct jQuery selector to select the first HTML element?
A. $("element_name.first")
B. $("element_name#first")
C. $("element_name::first")
D. $("element_name:first")
Answer: D) $("element_name:first")
9 4
Explanation:
21
The $("element_name:first") selector is used to select the first HTML element.
59
07
Discuss this Question
80
.in
21. Which is the correct jQuery selector to select the first <div> of the HTML document?
ys
A. $("div.first")
ra
B. $("div#first")
ar
C. $("div::first")
ith
D. $("div:first")
w
Answer: D) $("div:first")
de
Explanation:
co
The $("div:first") selector is used to select the first <div> of the HTML document.
22. Which is the correct jQuery selector to select the first list item of <ul> element?
A. $("ul li:first")
B. $("ul:first")
C. $("li:first")
D. $("ul.li:first")
Explanation:
The $("ul li:first") selector is used to select the first list item of <ul> element.
23. Which is the correct jQuery selector to select the first list item of every <ul> element?
A. $("ul li:first-child")
B. $("ul li:first.*")
C. $("li:first-child")
D. $("ul:first-child")
Explanation:
The $("ul li:first-child") selector is used to select the first list item of every <ul> element.
9 4
Discuss this Question
21
59
24. Which is the correct jQuery selector to select all elements having "href" attribute?
07
80
A. $("a.[href]")
B. $("a:[href]")
.in
C. $("[href].*")
ys
D. $("[href]")
ra
Answer: D) $("[href]")
ar
ith
Explanation:
w
The $("[href]") selector is used to select all elements having href attribute.
de
co
25. Which is the correct jQuery selector to select all <button> elements and <input> elements
with type="input"?
A. $(".button")
B. $(":button")
C. $("button","input type="button")
D. $(":button,:input")
Answer: B) $(":button")
Explanation:
The $(":button") selector is used to select all <button> elements and <input> elements
with type="input" .
Discuss this Question
26. Which is the correct jQuery selector to select all even table rows?
A. $("tr::even")
B. $("tr.even")
C. $("tr:even")
D. $("tr:#even")
Answer: C) $("tr:even")
Explanation:
9 4
21
27. Which is the correct jQuery selector to select all odd table rows?
A. $("tr::odd")
59
07
B. $("tr.odd")
80
C. $("tr:odd")
D. $("tr:#odd")
.in
ys
Answer: C) $("tr:odd")
ra
Explanation:
ar
ith
28. Which method is used to attach an event handler function to an HTML element on mouse
click?
A. click()
B. Click()
C. dblclick()
D. DblClick()
Answer: A) click()
Explanation:
The jQuery method click() is used to attach an event handler function to an HTML element on
mouse click.
Discuss this Question
29. Which method is used to attach an event handler function to an HTML element on mouse
double click?
A. click()
B. Click()
C. dblclick()
D. DblClick()
Answer: C) dblclick()
Explanation:
The jQuery method dblclick() is used to attach an event handler function to an HTML element on
mouse double click.
9 4
Discuss this Question
21
59
07
30. Which method is used to attach an event handler function to an HTML element when the
mouse pointer enters the HTML element?
80
A. mouseover()
.in
B. mousevisit()
ys
C. mouse-enter()
ra
D. mouseenter()
ar
Answer: D) mouseenter()
ith
Explanation:
w
de
The jQuery method mouseenter() is used to attach an event handler function to an HTML element
co
31. Which method is used to attach an event handler function to an HTML element when the
mouse pointer leaves the HTML element?
A. mouseLeave()
B. mouseleave()
C. mouse-leave()
D. mouseexit()
Answer: B) mouseleave()
Explanation:
The jQuery method mouseleave() is used to attach an event handler function to an HTML element
when the mouse pointer leaves the HTML element.
32. Which method is used to attach an event handler function to an HTML element when the left,
middle or right mouse button is pressed down, while the mouse is over the HTML element?
A. mousedown()
B. mouseover()
C. mousepress()
D. mousekey()
Answer: A) mousedown()
Explanation:
9 4
The jQuery method mousedown() is used to attach an event handler function to an HTML element
21
when the left, middle or right mouse button is pressed down, while the mouse is over the HTML
59
element.
07
Discuss this Question
80
.in
33. Which method is used to attach an event handler function to an HTML element when the left,
ys
middle or right mouse button is released, while the mouse is over the HTML element?
ra
A. mouseup()
ar
B. mouseover()
ith
C. mouseabove()
w
D. mousekey()
de
Answer: A) mouseup()
co
Explanation:
The jQuery method mouseup() is used to attach an event handler function to an HTML element when
the left, middle or right mouse button is released, while the mouse is over the HTML element.
34. Which method is used to attach an event handler function to an HTML element when the
mouse moves over the HTML elements?
A. mousemove()
B. mouseover()
C. hover()
D. mousehover()
Answer: C) hover()
Explanation:
The jQuery method hover() is used to attach an event handler function to an HTML element when the
mouse moves over the HTML elements.
35. Which method is used to attach an event handler function to an HTML element when the
form field gets focus?
A. focused()
B. focuses()
C. focuselement()
D. focus()
9 4
Answer: D) focus()
21
Explanation:
59
07
The jQuery method focus() is used to attach an event handler function to an HTML element when the
form field gets focus.
80
.in
36. Which method is used to attach an event handler function to an HTML element when the
ar
A. blur()
w
B. leave()
de
C. focusleave()
co
D. leavefocus()
Answer: A) blur()
Explanation:
The jQuery method blur() is used to attach an event handler function to an HTML element when the
form field loses focus.
37. Which method is used to attach one or more event handlers for the selected elements?
A. at()
B. atelements()
C. on()
D. focuson()
Answer: C) on()
Explanation:
The jQuery method on() is used to attach one or more event handlers for the selected elements.
9 4
Answer: A) To hide shown elements and to show hidden elements
21
Explanation:
59
The toggle() method is used to hide the shown elements and to show the hidden elements.
07
80
A. fade()
ar
B. fadeIn()
ith
C. fadeOut()
w
D. fadeToggle()
de
Answer: B) fadeIn()
co
Explanation:
A. $(selector).fadeIn();
B. $(selector).fadeIn(callback, speed);
C. $(selector).fadeIn(callback);
D. $(selector).fadeIn(speed,callback);
Answer: D) $(selector).fadeIn(speed,callback);
Explanation:
$(selector).fadeIn(speed,callback);
A. fadeout()
B. fadeIn()
C. fadeOut()
D. fadeToggle()
Answer: C) fadeOut()
9 4
Explanation:
21
59
The jQuery fadeOut() method is used to fade out a visible element.
07
Discuss this Question
80
.in
A. $(selector).fadeOut();
ra
B. $(selector).fadeOut(callback, speed);
ar
C. $(selector).fadeOut(callback);
ith
D. $(selector).fadeOut(speed,callback);
w
de
Answer: D) $(selector).fadeOut(speed,callback);
co
Explanation:
$(selector).fadeOut(speed,callback);
43. Which jQuery method toggles between the fadeIn() and fadeOut() methods?
A. toggle()
B. Toggle()
C. fadeToggle()
D. fadetoggle()
Answer: C) fadeToggle()
Explanation:
The jQuery fadeToggle() method toggles between the fadeIn() and fadeOut() methods.
A. $(selector).fadeToggle();
B. $(selector).fadeToggle(callback, speed);
C. $(selector).fadeToggle(callback);
D. $(selector).fadeToggle(speed,callback);
Answer: D) $(selector).fadeToggle(speed,callback);
9 4
Explanation:
21
The syntax of jQuery method fadeToggle() is:
59
07
$(selector).fadeToggle(speed,callback);
80
45. Which jQuery method allows fading to a given opacity (value between 0 and 1)?
ra
ar
A. fade()
ith
B. fadeOpacity()
w
C. fadeTo()
de
D. fadeto()
co
Answer: C) fadeTo()
Explanation:
The jQuery fadeTo() method allows fading to a given opacity (value between 0 and 1).
46. Which is the correct jQuery statement to fade out a <p> element?
A. $("p").fadeOut();
B. $("#p").fadeOut();
C. $(".p").fadeOut();
D. $("p").fadeout();
Answer: A) $("p").fadeOut();
Explanation:
$("p").fadeOut();
47. Which is the correct jQuery statement to fade out a <p> element with duration effect "slow"?
A. $("p").fadeOut("slow");
B. $("#p").fadeOut("slow");
C. $(".p").fadeOut("slow");
D. $("p").fadeout();
Answer: A) $("p").fadeOut("slow");
9 4
Explanation:
21
59
The jQuery statement to fade out a <p> elements with duration effect "slow" is:
07
$("p").fadeOut("slow");
80
.in
A. slideBottom()
ith
B. slideDown()
w
C. slidedown()
de
D. slide()
co
Answer: B) slideDown()
Explanation:
A. slideUp()
B. slideBottom()
C. slidebottom()
D. slide()
Answer: A) slideUp()
Explanation:
50. Which jQuery method toggles between the slideDown() and slideUp() methods?
A. slide ()
B. slideSwitch()
C. slidetoggle()
D. slideToggle()
Answer: D) slideToggle()
4
9
Explanation:
21
The jQuery slideToggle() method toggles between the slideDown() and slideUp() methods.
59
07
Discuss this Question
80
.in
A. animation()
ra
B. slidAnimate()
ar
C. animate()
ith
D. SlideAnimate()
w
Answer: C) animate()
de
Explanation:
co
A. $(selector).animate({params},speed,callback);
B. $(#selector).animate({params},speed,callback);
C. $(selector).animate(speed,callback);
D. $(selector).animate({speed,callback,params});
Answer: A) $(selector).animate({params},speed,callback);
Explanation:
The correct syntax of animate() method is:
$(selector).animate({params},speed,callback);
Explanation:
49
The params parameter of jQuery animate() method is used to define the CSS property to be
21
animated.
59
07 Discuss this Question
80
.in
54. In the syntax of animate() method, what is/are the valid value(s) of speed parameter?
ys
A. slow
ra
B. fast
ar
C. milliseconds
D. All of the above
ith
w
Explanation:
co
The following are the correct value of the speed parameter are:
slow
fast
milliseconds
A. animate(false)
B. animate('false')
C. animate("false")
D. stop()
Answer: D) stop()
Explanation:
A. $(selector).stop(stopAll,goToEnd);
B. $(selector).stop(speed,callback);
C. $(selector).stop(stopAll,goToEnd,callback);
D. $(selector).stop(stopAll,speed);
Answer: A) $(selector).stop(stopAll,goToEnd);
9 4
Explanation:
21
The correct syntax of stop() method is:
59
07
$(selector).stop(stopAll,goToEnd);
80
D. Document On Model
co
Explanation:
58. Which jQuery DOM method is used to set or return the text content of selected elements?
A. content()
B. text()
C. html()
D. val()
Answer: B) text()
Explanation:
The jQuery DOM method text() is used to set or return the text content of selected elements.
59. Which jQuery DOM method is used to set or return the content of selected elements
(including HTML markup)?
A. content()
B. text()
C. html()
D. val()
Answer: C) html()
Explanation:
9 4
21
The jQuery DOM method html() is used to set or return the content of selected elements (including
HTML markup).
59
07
Discuss this Question
80
.in
60. Which jQuery DOM method is used to set or return the value of form fields?
ys
A. content()
ra
B. text()
ar
C. html()
ith
D. val()
w
Answer: D) val()
de
co
Explanation:
The jQuery DOM method val() is used to set or return the value of form fields.
61. Which is the correct jQuery statement to get the text content of an HTML element having id
"notification"?
A. $("notification").text()
B. $("#notification").text()
C. $(".notification").text()
D. $("#notification").val()
Answer: B) $("#notification").text()
Explanation:
The jQuery statement $("#notification").text() will return the text content of the HTML
document having id "notification".
62. Which jQuery DOM method is used to get the attribute value?
A. attr()
B. attribute()
C. attrib()
D. val()
Answer: A) attr()
Explanation:
9 4
21
The jQuery DOM method attr() is used to get the attribute value.
59
07 Discuss this Question
80
63. Which is the correct jQuery statement to get the value "href" attribute having id "top"?
.in
A. $("top").attr("href")
ys
B. $(".top").attr("href")
ra
C. $("$top").attr("href")
ar
D. $("#top").attr("href")
ith
Answer: D) $("#top").attr("href")
w
de
Explanation:
co
The jQuery statement $("#top").attr("href") will return the the value href attribute having id
"top".
64. Which jQuery DOM method is used to insert content at the end of the selected elements?
A. insert()
B. add()
C. append()
D. appendValue()
Answer: C) append()
Explanation:
The jQuery DOM method append() is used to insert content at the end of the selected elements.
65. Which jQuery DOM method is used to insert content at the beginning of the selected
elements?
A. insert()
B. before()
C. append()
D. prepend()
Answer: D) prepend()
Explanation:
The jQuery DOM method prepend() is used to insert content at the beginning of the selected
9 4
elements.
21
59
Discuss this Question
07
80
66. Which jQuery DOM method is used to insert content after the selected elements?
.in
A. after()
ys
B. postpend()
C. addafter()
ra
D. prepend()
ar
ith
Answer: A) after()
w
Explanation:
de
co
The jQuery DOM method after() is used to insert content after the selected elements.
67. Which jQuery DOM method is used to insert content before the selected elements?
A. before()
B. addbefore()
C. addprepend()
D. prepend()
Answer: A) before()
Explanation:
The jQuery DOM method before() is used to insert content before the selected elements.
Discuss this Question
68. Which is the correct syntax to insert content at the end of the <p> elements?
A. $("#p").append("Text to be added");
B. $("p").before("Text to be added");
C. $("p").append("Text to be added");
D. $("p").prepend("Text to be added");
Explanation:
The correct syntax to insert content at the end of the <p> elements is:
$("p").append("Text to be added");
9 4
21
Discuss this Question
59
07
69. Which is the correct syntax to insert content at the beginning of the <p> elements?
80
A. $("#p").before("Text to be added");
.in
B. $("p").addafter("Text to be added");
C. $("p").after("Text to be added");
ys
D. $("p").prepend("Text to be added");
ra
ar
Explanation:
w
de
The correct syntax to insert content at the beginning of the <p> elements is:
co
$("p").prepend("Text to be added");
70. Which is the correct syntax to insert content after the <div> elements?
A. $("div").after("Text to be added");
B. $("div").postpend("Text to be added");
C. $("div").addafter("Text to be added");
D. $("#div").after("Text to be added");
Explanation:
The correct syntax to insert content after the <div> elements is:
$("div").after("Text to be added");
71. Which is the correct syntax to insert content before the <div> elements?
A. $("div").before("Text to be added");
B. $("div").pretpend("Text to be added");
C. $("div").addbefore("Text to be added");
D. $("#div").before("Text to be added");
Explanation:
49
The correct syntax to insert content before the <div> elements is:
21
59
$("div").before("Text to be added"); 07
80
Discuss this Question
.in
A. remove() removes the selected element and its child elements while empty() removes the child
ar
B. remove() removes the child elements of the selected element while empty() removes the selected
elements and its child elements
w
C. remove() removes the child elements while empty() removes the content of the selected element
de
D. remove() removes the child elements while empty() removes the content of the selected element
co
Answer: A) remove() removes the selected element and its child elements while empty() removes the
child elements of the selected element
Explanation:
The difference between remove() and empty() methods is: remove() removes the selected element
and its child elements while empty() removes the child elements of the selected element.
73. Write a jQuery statement to remove all child elements only from the element having id
"notif"?
A. $("notif").empty();
B. $("#notif").empty();
C. $(".notif").empty();
D. $("<notif>").empty();
Answer: B) $("#notif").empty();
Explanation:
The jQuery statement to remove all child elements only from the element having id "notif" is:
$("#notif").empty();
74. Write a jQuery statement to remove all <p> elements with class="prog"?
4
A. $(".prog").remove();
9
B. $("p").empty(".prog");
21
C. $("p").remove(".prog");
59
D. $("p.prog").remove(); 07
Answer: C) $("p").remove(".prog");
80
Explanation:
.in
The jQuery statement to removes all <p> elements with class="prog" is:
ys
ra
$("p").remove(".prog");
ar
ith
75. Write a jQuery statement to remove all <pre> elements with class="prog" and class="old"?
A. $(".prog#old").remove();
B. $("pre").empty(".prog",".old");
C. $("pre").remove(".prog, .old");
D. $("pre.prog.old").remove();
Explanation:
The jQuery statement to remove all <pre> elements with class="prog" and class="old" is:
$("pre").remove(".prog, .old");
A. add()
B. addClass()
C. addClasses()
D. AddClasses()
Answer: B) addClass()
Explanation:
The jQuery method addClass() is used to add CSS class to the selected elements.
77. Can we add more than one CSS classes to the selected elements using the addClass() method?
94
A. Yes
21
B. No
59
Answer: A) Yes 07
Explanation:
80
Yes, we can add more than one CSS classes to the selected elements using the addClass() method.
.in
ys
78. Which method is used to remove CSS class to the selected elements?
ith
w
A. removeCSS()
de
B. removeClass()
C. removeClasseses()
co
D. RemoveClass()
Answer: B) removeClass()
Explanation:
The jQuery method removeClass() is used to remove CSS class to the selected elements.
79. Which method is used to set or get the CSS style attribute?
A. cssAttribute()
B. attribute()
C. attr()
D. css()
Answer: D) css()
Explanation:
The jQuery method css() is used to get or set the CSS style attribute.
80. Which is the correct syntax to get the value of a CSS style attribute/property using the css()
method?
A. css("propertyname");
B. css(propertyname);
C. css(".propertyname");
D. css("#propertyname");
9 4
21
Answer: A) css("propertyname");
59
Explanation: 07
The correct syntax to get the value of a CSS style attribute/property using the css() method
80
is: css("propertyname");
.in
81. Which is the correct syntax to set the value of a CSS style attribute/property using the css()
ith
method?
w
A. css("propertyname"="value");
de
B. css("propertyname","value");
co
C. css("propertyname":"value");
D. css("propertyname":="value");
Answer: B) css("propertyname","value");
Explanation:
The correct syntax to set the value of a CSS style attribute/property using the css() method is:
css("propertyname","value");
82. Which is the correct jQuery statement to set background color and text decoration to all <p>
elements?
A. $("p").css({"background-color": "#f1f1f1"; "text-decoration": "underline"});
B. $("#p").css({"background-color": "#f1f1f1"; "text-decoration": "underline"});
C. $("p").css({"background-color": "#f1f1f1", "text-decoration": "underline"});
D. $("#p").css({"background-color": "#f1f1f1", "text-decoration": "underline"});
Explanation:
The correct jQuery statement to set background color and text decoration to all <p> elements is:
83. Which jQuery method is used to get or set the width of an HTML element?
9 4
A. cssWidth()
21
B. Csswidth()
59
C. lenght() 07
D. width()
80
Answer: D) width()
.in
Explanation:
ys
The jQuery method width() is used to get or set the width of an HTML element.
ra
ar
84. Which jQuery method is used to get or set the height of an HTML element?
co
A. cssHeight()
B. CssHeight()
C. height()
D. getHeight()
Answer: C) height()
Explanation:
The jQuery method height() is used to get or set the height of an HTML element.
85. Which jQuery methods are used to get or set the width and height of an HTML element
including the paddings?
A. innerWidth() and innerHeight()
B. width() and height()
C. cssWidth() and cssHeight()
D. elementWidth() and elementHeight()
Explanation:
The jQuery methods innerWidth() and innerHeight() are used to get or set the width and height
of an HTML element including the paddings.
86. Which jQuery methods are used to get or set the width and height of an HTML element
including the paddings and borders?
94
A. outerWidth() and outerHeight()
21
B. width() and height()
59
C. cssWidth() and cssHeight()
D. elementWidth() and elementHeight()
07
Answer: A) outerWidth() and outerHeight()
80
Explanation:
.in
ys
The jQuery methods outerWidth() and outerHeight() are used to get or set the width and height
ra
87. Which are the jQuery methods for traversing up the DOM tree?
co
A. parent()
B. parents()
C. parentsUntil()
D. All of the above
Explanation:
These are the jQuery methods for traversing up the DOM tree:
i. parent()
ii. parents()
iii. parentsUntil()
A. parent()
B. parents()
C. parentsUntil()
D. All of the above
Answer: A) parent()
Explanation:
jQuery method parent() is used to get the direct parent element of the selected element.
89. Which jQuery method is used to get the all ancestor elements of the selected element, all the
9 4
way up to the document's root element (<html>)?
21
A. parent()
59
B. parents() 07
C. parentsUntil()
D. All of the above
80
Answer: B) parents()
.in
ys
Explanation:
ra
jQuery method parents() is used to get the all ancestor elements of the selected element, all the way
ar
90. Which jQuery method is used to get the all ancestor elements between two given arguments?
A. parent()
B. parents()
C. parentsUntil()
D. All of the above
Answer: C) parentsUntil()
Explanation:
jQuery method parentsUntil() is used to get the all ancestor elements between two given
arguments.
A. $("pre").parent();
B. $("pre").parents();
C. $("pre").parentsUntil();
D. None of the above
Answer: A) $("pre").parent();
Explanation:
The correct jQuery statement to get the direct parent of a <pre> tag is:
$("pre").parent();
9 4
92. Which are the jQuery methods for traversing down the DOM tree?
21
59
A. children()
B. find()
07
C. childrens()
80
D. Both A. and B.
.in
Explanation:
ra
ar
These are the jQuery methods for traversing down the DOM tree:
ith
i. children()
w
ii. find()
de
co
93. Which jQuery method is used to get all direct children of the selected element?
A. children()
B. find()
C. childrens()
D. Both A. and B.
Answer: A) children()
Explanation:
jQuery method children() is used to get all direct children of the selected element.
A. children()
B. find()
C. childrens()
D. Both A. and B.
Answer: B) find()
Explanation:
jQuery method find() is used to get descendant elements of the selected element, all the way down
to the last descendant.
4
9
21
95. What will the following jQuery code do?
59
$(document).ready(function(){
07
$("pre").siblings();
80
});
.in
Explanation:
de
co
The above code will return all sibling elements of <pre> element.
96. Which is the correct jQuery statement to change the color of all <p> elements which are
sibling elements of <pre>?
A. $("#pre").siblings("p").css({"color": "red"});
B. $(".pre").siblings("p").css({"color": "red"});
C. $("pre").siblings(".p").css({"color": "red"});
D. $("pre").siblings("p").css({"color": "red"});
Explanation:
The correct jQuery statement to change the color of all <p> elements which are sibling elements
of <pre> is:
$("pre").siblings("p").css({"color": "red"});
97. Which jQuery method is used to get the next sibling element of the selected element?
A. sibling()
B. nextSibling()
C. next()
D. siblings()
Answer: C) next()
4
Explanation:
9
21
jQuery method next() is used to get the next sibling element of the selected element.
59
07 Discuss this Question
80
.in
98. Which jQuery method is used to get the all next sibling element of the selected element?
ys
A. siblingAll()
ra
B. nextSiblingAll()
ar
C. nextAll()
D. siblingsAll()
ith
w
Answer: C) nextAll()
de
Explanation:
co
jQuery method nextAll() is used to get the all next sibling element of the selected element.
99. Let suppose there are multiple <h3> elements in an HTML document, which is the correct
jQuery statement to get the first <h3> element?
A. $("h3").first();
B. $("h3").parent();
C. $("h3").firstParent();
D. $("h3").top();
Answer: A) $("h3").first();
Explanation:
The correct jQuery statement to get the first <h3> element is:
$("h3").first();
100. Let suppose there are multiple <h3> elements in an HTML document, which is the correct
jQuery statement to get the last <h3> element?
A. $("h3").last();
B. $("h3").children();
C. $("h3").lastChild();
D. $("h3").down();
4
Answer: A) $("h3").last();
9
21
Explanation:
The correct jQuery statement to get the last <h3> element is:
59
07
80
$("h3").last();
.in
ys
ra
ar
ith
w
de
co
https://www.youtube.com/@codewitharrays
https://www.instagram.com/codewitharrays/
https://codewitharrays.in/project