These jQuery multiple-choice questions and their answers will help you strengthen your grip on the subject of jQuery. You can prepare for an upcoming exam or job interview with these jQuery MCQs.
So scroll down and start answering.
A. Secret
B. Private
C. Open source
D. Proprietary
A. First the height animates, then the width animates.
B. First the width animates, then the height animates.
C. Both the width and height animates at the same time.
A. $('div').handler('click',function {alert(1);});
B. $('div').bind('click',function {alert(1);});
C. $('div').call('click',function {alert(1);});
D. $('div').event('click',function {alert(1);});
A. after everything has loaded
B. after everything except other scripts are loaded
C. after all other javascript has been read and executed
D. before anything has loaded
E. after the DOM has loaded, but prior to anything else loading
A. Select only elements in a disabled state
B. Create a new element with the state set to disabled
C. None of the above
D. Disable any elements currently set to an enabled state
A. visibility: hidden;
B. display: none;
C. height: 0;
D. opacity: 0;
A. jQuery object
B. HTML text
C. result set
D. recordset
A. object
B. here
C. this
D. medium
E. that
A. No difference. width() is a shorthand alias for outerWidth()
B. Only difference is .width() returns a number & outerWidth() returns a string.
C. width() returns the computed width of the element while outerWidth() returns the width plus all the margins and paddings.
A. True
B. False
A. Name
B. element
C. Attribute
D. element's ID
A. JavaScript
B. C++
C. Java
D. PHP
A. PHP
B. JavaScript
C. CSS
D. Java
A. $(':name')
B. $('#name')
C. $('.name')
A. $(script src)="jQuery.js"(/script)
B. <script src="jQuery.js"></script>
C. $script src="jQuery.js"
D. $(script) src="jQuery.js")
A. Server Scripting
B. Client Scripting
A. $('_name')
B. $('#name')
C. $('.name')
A. Allows you to select an array in the node list.
B. Allows the content to be stopped at some point.
C. Allows you to select HTML elements (or groups of elements) by element name, attribute name or by content.
D. Allows selection of libraries.
A. toggle()
B. show()
C. fadeIn()
D. alias()
A. Changes the background color of the element with class 'effect' to #fff within 1 second.
B. Changes the background color of the element with id 'effect' to #fff within 1 second.
A. No
B. Yes
A. display(none)
B. hidden()
C. hide()
D. hide(display)
A. Takes the name of an attribute and duplicates it.
B. Takes the name of an attribute on your page and gives the value of that attribute.
C. Takes the name of an attribute on the page and makes it animate.
D. Takes the element and duplicates it.
A. ${."myID"}
B. ${"#myID"}
C. #{".myID"}
D. $("#myID")
A. #
B. *
C. &
D. ?
A. True
B. False
A. java();
B. Function();
C. function();
D. operator();
E. jQuery();
A. toggle
B. reverse
C. alternate
D. flip
E. switch
A. fadeIn('three')
B. fadeIn(3000)
C. fadeIn('3 seconds')
D. fadeIn('3 sec')
E. fadeIn(3)
A. $('p').css('color', 'red');
B. $('p').css('color: red;');
C. $('p').css('color: red');
A. $('#myClass')
B. #(".myClass")
C. $(".myClass")
D. $("#myClass")
A. $("book").fadeOut{}
B. jQuery("book").fadeOut{}
C. $(#book).fadeOut();
D. $("#book").fadeOut();
A. $.stripspace( )
B. jQuery does not provide such function.
C. $.strip( )
D. $.trim( )
A. $('#foo').display('show');
B. $('#foo').style('show');
C. $('#foo').showElement();
D. $('#foo').show();
A. use .hasThis()
B. use.class()
C. use .isClass()
D. use .hasClass()
E. use .getClass()
A. .copy()
B. .clone()
C. .duplicate()
D. .repeat()
A. client browser
B. client server
C. host server
D. host browser
A. Overcome cross-browser issues
B. Rapid web development
C. Simplify JavaScript coding
D. All of these
A. There is no find() function
B. There is no children() function
C. Both do similar tasks
D. The .find() and .children() methods are similar, except that the latter only travels a single level down the DOM tree.
A. classSwitch()
B. switch()
C. switchClass()
D. toggleClass()
A. Remove Whitespace from beginning & ending of string
B. trim() is not a valid Jquery function
C. Remove Whitespace from beginning of string
D. Remove Whitespace from end of string
A. True
B. False
A. Java
B. CSS
C. HTML
D. DOM
A. $("div#mydiv").never("
Paragraph
");B. $("
Paragraph
").appendTo("div#mydiv");C. $("div#mydiv").before("
Paragraph
");D. $("
Paragraph
").new("div#mydiv");A. $(#box).fadeOut().fadeIn()
B. $("#box").fadeOut().fadeIn();
C. $(“box”).fadeOut().fadeIn()
D. $(<#box>).fadeOut().fadeIn();
A. .load()
B. .show()
C. .ready()
D. .hide()
A. $("div").height(100)
B. $("div").height="100"
C. $("div").height.pos=100
D. $("div").height=("100")
A. $("#someID").css("color","red");
B. $("#someID"))((.style("color","red");
C. $.css("color:red");
D. $("#someID").css("color:red");
A. div:left
B. li:last
C. p:first
D. tr:even
E. tr:odd
A. $('first.span.white')
B. $('white;span;first')
C. $('span.white:first')
D. $('span; white: first')
A. False
B. True
A. var member= "<?php echo $member_value; ?>";
B. var member= <?php $member_value; ?>;
A. blue
B. p
C. .css
D. color
A. Yes
B. No
A. False
B. True
A. $('.name')
B. $(':name')
C. $('#name')
A. $(img).setAttribute('src', 'photo.jpg');
B. $('img').attr('src', 'photo.jpg');
C. $('img src').set('photo.jpg');
D. $('img').attr('src').set('photo.jpg');
A. $('.grid12');
B. $('div+.grid12');
C. $('#container+div');
D. $('div');
E. $('#container');
A. jQuery.foo()
B. javascript.foo()
C. None of them
D. document.foo()
A. Animate the tag with myID from the current width to 90% width.
B. Animate the tag with myID from 90% width to 0% width.
C. Animate the tag with myID from 90% width to 100% width.
D. Animate the tag with myID from 90% width to the current width.
A. .on()
B. .link()
C. .behavior()
D. .attach()
A. universal selectors
B. All of these choices are subsets
C. attribute selectors
D. child selectors
E. css3 selectors
A. All div elements with class=
B. All div elements with id=
C. The first div element with class=
D. The first div element with id=
A. $a.click(function (e) { /* code */ e.returnValue = false; });
B. $a.click(false);
C. $a.click(function (e) { /* code */ e.preventDefault(); });
D. $a.click(function () { /* code */ return false; });
A. left carat (<)
B. minus (-)
C. right carat (>)
D. medium
E. plus (+)
A. $("...").foobar( option1: 123, option2: 9 );
B. $("...").foobar({ option1: 123, option2: 9 });
C. $("...").foobar([ option1: 123, option2: 9 ]);
A. style()
B. css()
C. javascript()
D. html()
A. window.setTimeout(function(){ // some code }, 2);
B. window.delayed(function(){ // some code }, 2000);
C. window.timeOut(function(){ // some code }, 2);
D. window.setTimeout(function(){ // some code }, 2000);
A. attach();
B. click();
C. .on();
A. :one-based()
B. :even
C. :odd
D. :nth-child()
A. It returns the DOM elements that are contained in the jQuery object.
B. It returns an object
C. It fires a GET OBJECT request
D. It fires a GET AJAX request
A. graceful degradation
B. progressive enhancement
C. callback function
D. chaining
E. AJAX
A. duplicate the element id 'mydiv'
B. Create a parent 'div' tag for element id 'mydiv'.
C. Create a div next to the element id 'mydiv'
A. after()
B. more()
C. later()
D. outside()
A. Allows you to animate any CSS property controlled by an alphabetic value
B. Allows you to animate CSS property controlled by a numeric value
C. Allows you to create a cartoon using the DOM
A. statement
B. it ends a statement
C. Chaining
D. an effect that disables
A. 500
B. All of these
C. Leave it blank
D. 'fast'
A. $('p').append('text to add');
B. $('p').content('text to add');
C. $('p').text('text to add');
D. $('p').html('text to add');
E. $('p').prepend('text to add');
A. document.write()
B. echo()
C. .content()
D. .html()
A. $(document).pageloadcomplete(function () { /* Code goes here */ });
B. document.ready(function () { /* Code goes here */ });
C. $(document).ready(function () { /* Code goes here */ });
D. $(document).ready(function { /* Code goes here */ });
E. $(document).ready({ /* Code goes here */ });
A. False
B. True
A. 'color'
B. .css
C. $('p')
D. 'blue'
A. hierarchical relationship
B. comparison operator
C. child selector
D. directional indicator
E. chaining
A. cloneTo()
B. clone()
C. copy()
D. moveTo()
A. It adds the string 'page.html' as the contents of the #myDiv div.
B. it loads the #myDiv on the contents of the 'page.html' browser
C. it fires an AJAX request, fetches the result of page.html as text, and inserts it into the div
A. remove() method removes the selected element(s) and its child elements whereas empty() method removes the child elements of the selected element(s)
B. they are same
C. remove() method removes the child elements of the selected element(s) whereas empty() method removes the selected element(s) and its child elements
A. next()
B. next_element()
C. medium
D. next_sibling()
E. sibling()
A. outer join
B. stringing
C. concatenation
D. chaining
A. .die()
B. .browser()
C. .live()
D. .sub()
E. All of these
A. It simulates a click on the element and runs all the event handlers associated with it.
B. It sets up a trigger. When a click occurs, the trigger is going to be activated.
C. It makes a click on any element and creates a trigger.
D. When a click occurs the trigger is going to be activated.
A. .noConflict()
B. medium
C. .$()
D. .library()
E. .return()
A. .ajaxComplete()
B. .ajaxSend()
C. .ajaxError()
D. .ajaxRun()
E. .ajaxStop()
A. $('div.element')
B. $('.element')
C. $('#element')
D. $('div#element')
A. appendTo
B. createChild
C. insertNew
D. addChild
E. expandFamily
A. stop() halts the execution of the scripts on the page until any animations have finished.
B. stop() ends any currently running animations on the element.
C. to stop the animation after it has finished.
D. to tell jQuery that the animation has to be stopped at some point.
A. clearQueue()
B. hide()
C. dequeue()
D. queue()
A. speeding
B. velocity
C. gradient
D. resizing
E. easing
A. .find()
B. .closest()
C. .children()
D. .siblings()
A. global event
B. event bubbling
C. upward progress
D. medium
E. progressive enhancement
A. mouse()
B. switch()
C. hover()
D. toggle()
E. change()