jQuery Test
Which option is correct to use the below function to set cursor position for textarea? Function: $.fn.selectRange = function(start, end) { return this.each(function() { if (this.setS...
$('#a1').one('click', {times: 3}, function1); Which of the following is true for the above?
$('#id1').animate({width:"80%"}, "slow") The above code snippet will ___.
$("div").find("p").andSelf().addClass("border"); The statement adds class border to ___.
$("div").find("p").andSelf().addClass("border"); The statement adds class border to ___.
Assume that you want that first the tag with "id1" fades out and then the tag with "id2" fades in. Which of the following code snippets allow(s) you to do so?
Assuming that the jQuery UI library is used to make a list sortable, which of the following code snippets makes "list1" sortable?
Consider the following code snippet: <font size=2> <ul id='id1'> <li id='li1'>Items 1</li> <li id='li2'>Items 2</li> <li id='li3'>Items 3</li> </ul> </font> Which of the following c...
Consider the following code snippet: <ul id='id1'> <li id='li1'>Items 1</li> <li id='li2'>Items 2</li> <li id='li3'>Items 3</li> </ul> Which of the following code snippets returns the...
Consider the following code snippet: $('#button1').bind('click', function(data) {...}); What is the data argument?
Consider the following code snippet: $('#ul1 li').live('click', function1); $('#ul1').after('&#60;li id="lastLi"&#62;Last item&#60;/li&#62;'); Is function1 executed if "lastLi" is clicked?
Consider the following code snippet: $('#id1').animate({width:"240px"}, { queue:false, duration:1000 }).animate({height:"320px"}, "fast"); The order of the animations of this code snippet is ___.
Consider the following code snippet: $('#table1').find('tr').filter(function(index) { return index % 3 == 0}).addClass('firstRowClass'); The result of the above code snippet is ___.
Consider the following code snippet: $(document).ready(function() { $('div').each(function(index) { alert(this); }); }); Which of the following objects does the 'this' variable refer to?
Consider the following code snippet: <font size=2> <ul id='id1'> <li id='li1'>Items 1</li> <li id='li2'>Items 2</li> <li id='li3'>Items 3</li> </ul> </font> Which of the following code snippe...
Consider the following code snippet: <ul id='id1'> <li id='li1'>Items 1</li> <li id='li2'>Items 2</li> <li id='li3'>Items 3</li> </ul> Which of the following code snippets return(s) a set of ...
Consider the following code snippet: <ul id='id1'> <li id='li1'>Items 1</li> <li id='li2'>Items 2</li> <li id='li3'>Items 3</li> </ul> Which of the following code snippets returns the same re...
Consider the following code snippet: $('#button1').bind('click', function(data) {...}); What is the data argument?
Consider the following code snippet: $('#id1').animate({width:"240px"}, { queue:false, duration:1000 }).animate({height:"320px"}, "fast"); The order of the animations of this code snippet is ___.
Consider the following code snippet: $('a.arrow-1').click(function () { $('.second-row').slideUp(); $(this).parent('.first-row').siblings('.second-row').slideDown(); }); The order of the a...
Consider the following code snippet: $('span.item').each(function (index) { $(this).wrap('<li>Item</li>'); }); What does this code snippet do?
Consider the following code snippet: $(document).ready(function1); $(document).ready(function2); $(document).ready(function3); Which of the following functions are executed when DOM is ready?
each() is a generic ___ function.
How can an Ajax request that has not yet received a response be canceled or aborted?
How can the child img be selected inside the div with a selector?
How can the href for a hyperlink be changed using jQuery?
If jQuery is included before another library, how can conflict between jQuery and that library be avoided?
jQuery allows simulating an event to execute an event handler as if that event has just occurred by using ___.
jQuery allows you to use ___ function to switch between showing and hiding an element.
offset function gets the current offset of the first matched element in pixels relative to the ___.
One advantage of $.ajax function over $.get or $.post is that ___.
The height function returns the height of an element in ___.
The hide() function hides an element by ___.
The position function gets the ___ positions of an element that are relative to its offset parent.
Using an element of some kind that is being hidden using .hide() and shown via .show(). Which of the following is the best way to determine if that element is currently hidden or visible on the sc...
What does $('tr.rowClass:eq(1)'); return?
What is the purpose of $(document).ready() function in Jquery?
What is the result of NaN == NaN?
What is the result of this function: jQuery.makeArray ( true )?
Which of the following code snippets insert(s) the code snippet <div class="footer">footer</div> at the end of div tags?
Which of the following code snippets insert(s) the code snippet <font size=2><div class="footer">footer</div></font> at the end of div tags?
Which of the following events can be used to disable right click contextual menu?
Which of the following functions can be used to stop event propagation?
Which of the following functions is/are built-in jQuery regular expression function(s)?
Which of the following gets the href attribute of "id1"?
Which of the following is the correct use of ajaxStart() function?
Which of the following is the correct way to add an additional option and select it with jQuery?
Which of the following is the correct way to change the image source during click event of a button in jQuery?
Which of the following is the correct way to debug JavaScript/jQuery event bindings with Firebug or a similar tool?
Which of the following is the correct way to disable an input field with jQuery?
Which of the following is the correct way to get "Option B" with the value '2' from following HTML code in jQuery? <select id='list'> <option value='1'>Option A</option> <option value='2'>O...
Which of the following is the correct way to get the value of a textbox using id in jQuery?
Which of the following is the correct way to manage a redirect request after a jQuery Ajax call?
Which of the following is the correct way to select an option based on its text in jQuery?
Which of the following methods can be used to copy element?
Which of the following methods can be used to utilize the animate function with the backgroundColor style property?
Which of the following represents the best way to make a custom right-click menu using jQuery?
Which of the following returns the children tags of "id1"?
Which of the following values is/are valid value(s) of secondArgument in addClass('turnRed', secondArgument); function, if the jQuery UI library is being used?
Which of the following will get the first column of all tables using jQuery?
Which of the following will show an alert containing the content(s) of a database selection?
Which option can be used to have jQuery wait for all images to load before executing something on a page?
Which option is correct to perform a synchronous AJAX request?

Consider the following code snippet:

<ul id='id1'>
  <li id='li1'>Items 1</li>
  <li id='li2'>Items 2</li>
  <li id='li3'>Items 3</li>
</ul>

Which of the following code snippets return(s) a set of all li tags within id1 except for the li tag with id li2?

Whats the right way to access the contents of an iframe using jQuery?

Consider the following code snippet:

<ul id='id1'>
  <li id='li1'>Items 1</li>
  <li id='li2'>Items 2</li>
  <li id='li3'>Items 3</li>
</ul>

Which of the following code snippets returns the same result as $('#id1 li').not($('#li2'));?

Which of the following will select a particular option in a <select> element using its index?

Consider the following code snippet:

$('#ul1 li').live('click', function1);
$('#ul1').after('<li id="lastLi">Last item</li>');

Is function1 executed if lastLi is clicked?

Which of the following functions will return an empty set when end() function is chained right after that function?

Consider the following code snippet:

var message = 'Message';

$('#id1').bind('click', function() {
    alert(message);
});

message = 'New message';

$('#id2').bind('click', function() {
    alert(message);
});

What does the alert box display if "id1" is clicked?

How or where can a plugin be declared, so that the plugin methods are available for the script?
Which of the following makes use of jQuery to select multiple elements?
Which of the following is correct with regards to how to upload a file asynchronously with jQuery?
Consider having multiple $(document).ready() functions in one or many linked JavaScript files. Given this information, which of the following will be executed?
Which of the following methods can be used to load data?
Which of the following values is/are valid argument(s) of the eq() function?
$.merge(array1, array2); The above function merges ___.
Using an element of some kind that is being hidden using .hide() and shown via .show(). Which of the following is the best way to determine if that element is currently hidden or visible on the screen?

Consider the following code snippet:

$('#id1').animate({width:"240px"}, "slow").animate({height:"320px"}, "fast");

The order of the animations of this code snippet is:

Which of the following is the correct way to assign a selected value of a drop-down list using jQuery?
Which of the following is the correct way to distinguish left and right mouse click event in jQuery?
Which of the following is the best way to open a jQuery UI dialog box without a title bar?
Which of the following is the correct way to select <a> on the basis of href using jQuery?
Which of the following is the correct way to do the following JavaScript Code with jQuery? var d = document; var odv = d.createElement("div"); odv.style.display = "none"; this.OuterDiv = odv; var t = d.createElement("table"); t.cellSpacing = 0; t.className = "text"; odv.appendChild(t);

Consider the following code snippet:

<div id='id1'>
    <div id='id2'>Div 2</div>
</div>

Which of the following tags is/are in the result of $('#id2').parents();?

Which of the following is the correct way to check which key was pressed?
$.grep(array1, function1); The above statement ___ the elements of array1 array which satisfy function1 function.
Which of the following is the correct way to get "Option B" with the value '2' from following HTML code in jQuery? <select id='list'> <option value='1'>Option A</option> <option value='2'>Option B</option> <option value='3'>Option C</option> </select>

Consider the following code snippet:

$.map(array1, function1);

Which of the following arguments is/are valid arguments of function1?

How can jQuery be used or optimized in such a way that the web applications can become richer and more functional?
Which of the following statements returns the number of matched elements of $('.class1')?
Which of the following will make the background of a page change, upon being refreshed?
Which of the following is the correct way to use jQuery with node.js?
How can an additional row be added to a table as the last row using jQuery?
Which of the following is the best method for adding options to a select from a JSON object using jQuery?
Which of the following is the correct way to refresh a page with jQuery?
Which of the following functions moves p tags that have para class to div with content id?
Which of the following is the correct way to check the existence of an element in jQuery other than the following code? if ($(selector).length>0) { // Do something }
The css() function allows you to ___.
Which option is correct to use the below function to set cursor position for textarea? Function: $.fn.selectRange = function(start, end) { return this.each(function() { if (this.setSelectionRange) { this.focus(); this.setSelectionRange(start, end); } else if (this.createTextRange) { var range = this.createTextRange(); range.collapse(true); range.moveEnd('character', end); range.moveStart('character', start); range.select(); } }); };

Consider the following code snippet:

<form id="form1">
    <input type="text" id="text1" value="default" />
    <input type="text" name="email" />
</form>

<script type="text/javascript">
    function submitForm1() {
        alert($('#form1').serialize());
    }
</script>

What does the alert box display when the function submitForm1 is called?

Which of the following is the correct way to move an element into another element?