jQuery Quiz | Set-2

  • Last Updated : 20 Sep, 2021

12
Question 1
Which one of the following is the correct option for the toggle() in jQuery?
A
Element will hide and show
B
Element will Fade In and Out
C
Element will up and down
D
Element will Animate and Hide
jQuery Quiz | Set-2    
Discuss it


Question 1 Explanation: 
In jQuery toggle() is used to element will hide and show for the given selected element. The main purpose of a toggle in jQuery is to check it for visibility.
Question 2
How to find the current selection against an expression in jQuery ?
A
getIs( selector )
B
findls( selector )
C
is( selector )
D
None of the above
jQuery Quiz | Set-2    
Discuss it


Question 2 Explanation: 
It is a pseudo-class selector that takes the list as an argument and selects any element that can be selected as any one of its lists The is(selector) in jQuery is used to find the current selection against an expression of the element and it returns a Boolean value if any element finds that suit then it returns a true value.
Question 3
Which of the below method is responsible for merging the two or more objects into the first object ?
A
check() Method
B
find() Method
C
obj() Method
D
extend() Method
jQuery Quiz | Set-2    
Discuss it


Question 3 Explanation: 
This extends() Method in jQuery is used to merge the contents of two or more objects together into the first object. Here it takes 4 parameters deep, target, object 1, and object N. And the return type of this is the merged object.
Question 4
Which selector will select all enable forms in jQuery?
A
:enabled selector
B
:file selector
C
:reset selector
D
:button selector
jQuery Quiz | Set-2    
Discuss it


Question 4 Explanation: 
The :enabled selector is used to selecting all enabled form elements. It is used for selecting HTML elements that support the disabled attribute. That button tag, input tag, opt group tag, option tag, select tag, and text-area tag.
Question 5
Which jQuery method is used to make the Ajax call?
A
ready(url, [data], [callback] )
B
load( url, [data], [callback] )
C
reload(url, [data], [callback] )
D
None of the above.
jQuery Quiz | Set-2    
Discuss it


Question 5 Explanation: 
The jQuery load() method is simple but very powerful AJAX method. The Load() method in jQuery helps to load data from the server and returned it into a selected element without loading the whole page. Syntax is $(selector).load(URL, data, callback); It takes 3 parameter URL, data and callback. Hence answer is option B.
Question 6
Which method is used to check whether an element is selected or not ?
A
hasClass()
B
toggleClass()
C
find()
D
addClass()
jQuery Quiz | Set-2    
Discuss it


Question 6 Explanation: 
The hasClass() is an inbuilt method in jQuery which checks whether the elements with the specified class name exists or not. The syntax is $(selector).hasClass(className); .It accepts a “className” parameter which specifies the class name need to search in the selected element. It returns true if the search is successful otherwise false.
Question 7
The Query.noConflict(true) in jQuery is used for___
A
free up the $ symbol by other libraries
B
Improve compatibility
C
Remove all jQuery variables
D
All of the above
jQuery Quiz | Set-2    
Discuss it


Question 7 Explanation: 
The Query.noConflict(true) is a method in jQuery that is used to releases the hold. It is used in ) Free up the $ symbol for use by other libraries, Improve compatibility and Remove all jQuery variables.
Question 8
Which jQuery method is used to check that event.stopPropagation() method was ever called on event object ?
A
isDefaultPrevented( ) Method
B
isPropagationStopped( ) Method
C
isImmediatePropagationStopped( ) Method
D
None of the above.
jQuery Quiz | Set-2    
Discuss it


Question 8 Explanation: 
The event.isPropagationStopped() Method in jQuery is used to check whether the object event.stopPropagation() is called or not. If event.stopPropagation() is called then it returns true otherwise returns false.
Question 9
Which one of the following options is true for selecting the specified text?
A
:target()
B
:selects()
C
:choose
D
None of the them
jQuery Quiz | Set-2    
Discuss it


Question 9 Explanation: 
The: select() is uses for selecting the specified text that is used to trigger the event. So the answer is: selects().
Question 10
In jquery css(‘width’) are the way to changing the width of?
A
Selector
B
Element
C
Fade effect
D
Radio button
jQuery Quiz | Set-2    
Discuss it


Question 10 Explanation: 
The css(‘width’) methods for changing the element in Jquery one is css(‘width’) and another one is .widhth().
There are 15 questions to complete.
12

My Personal Notes arrow_drop_up


Writing code in comment? Please use ide.geeksforgeeks.org, generate link and share the link here.