jQuery Quiz | Set-1

  • Last Updated : 23 Sep, 2021

Question 1
Which sign is used for the shortcut of the jquery?
A
@ sign
B
% sign
C
& sign
D
$ sign
jQuery Quiz | Set-1    
Discuss it


Question 1 Explanation: 
In the jquery, selector start with a dollar sign($).If you want to select any element you need to uses the dollar sign before selecting the element. Hence the correct option is D.
Question 2
Which of the following is the correct syntax to set the background color of all h1 elements to Green in jQuery?
A
$("h1").html("background-color","Green");
B
$("h1").layout("background-color","Green");
C
$("h1").style("background-color","Green");
D
$("h1").css("background-color","Green");
jQuery Quiz | Set-1    
Discuss it


Question 2 Explanation: 
In jQuery, using the css() method, we can set the style of an HTML element. The correct syntax for setting the background color to yellow of an h1 element is - $("h1").css("background-color","Green|");
Question 3
Which method is used to find the current selection against an expression?
A
getIs( selector )
B
findls( selector )
C
is( selector )
D
None of the above.
jQuery Quiz | Set-1    
Discuss it


Question 3 Explanation: 
The is(selector) in jquery is used to find the current selection against an expression of the element it returns a Boolean value if any element finds that suit then it returns a true value.
Question 4
Which of the below method is used to binds a handler to one or more events for an element?
A
attach(type, [data], fn )
B
catch(type, [data], fn )
C
bind( type, [data], fn )
D
All of the above
jQuery Quiz | Set-1    
Discuss it


Question 4 Explanation: 
The method used to bind one or more events is a bind that takes three parameters name types, data, and fn. The overall syntax is bind(type,[data],fn).This method is also used to bind the custom events.
Question 5
If the content of two or more objects is merged into the first object then which below method is used?
A
jQuery check() Method
B
jQuery extend() Method
C
jQuery obj() Method
D
None of the above
jQuery Quiz | Set-1    
Discuss it


Question 5 Explanation: 
The jquery extend() method is used to merge two objects in one. And the return type of this is merged object.
Question 6
Which of the below method is used to get the JSON data using HTTP requests?
A
jQuery.getScript( url, [callback] )
B
jQuery.post( url, [data], [callback], [type] )
C
jQuery.post( url, [type] )
D
jQuery.getJSON( url, [data], [callback] )
jQuery Quiz | Set-1    
Discuss it


Question 6 Explanation: 
The jQuery.getJSON takes 4 parameters URL, data, callback, and type which is used to load the JSON data.
Question 7
Out of the below jQuery method which one is used to find the highest property of the element ?
A
height( )
B
getCSSheight( )
C
getheight( )
D
All of the above.
jQuery Quiz | Set-1    
Discuss it


Question 7 Explanation: 
The height() method in jQuery is used to get the highest property of the element.
Question 8
Which method is used in a single global function in jQuery ?
A
$()
B
local()
C
jQuery()
D
global()
jQuery Quiz | Set-1    
Discuss it


Question 8 Explanation: 
The jquery function is used to define the global symbol. Hence , the jQuery() function is the single global function in jQuery.
Question 9
If you hide the selected element in jquery which jquery method did you have to choose from below?
A
display(none) Method
B
hidden(element) Method
C
hide() Method
D
visible(false) Method
jQuery Quiz | Set-1    
Discuss it


Question 9 Explanation: 
The hide() method is used to hide the selective elements in the query. Hence the options hide() method.
Question 10
Which one of the following function is the utility function that used in the jQuery?
A
jQuery.parseJSON()
B
jQuery.noConflict()
C
jQuery.Conflict()
D
jQuery.each()
jQuery Quiz | Set-1    
Discuss it


Question 10 Explanation: 
The jQuery.parseJSON() it take string value and return the JavaScript value. So it is used as a utility function in the jQuery.
There are 15 questions to complete.
My Personal Notes arrow_drop_up


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