Upwork jQuery Test 2018

Upwork jQueryTest Answers 2018

40 Answered Test Questions:


1)Select the recommnded way if cailing multiple functions one after another on an          element:
a)$('#someElement').hide();
   $('#someElement').html('Hidel');
   $('#someElement').customFunction();
b)$('#someElement').hide().html('hide!').customfunction();
c)var someElement=$('#someElement');
  someElement.hide();
  someElement.html('Hide!');
  SomeElement.otherStuff();
d)None of the above

2)Which of the following correctly uses the replace() method?
a)var valr='r';
  valr,replace('r','t');
  $('.try').prepend('<div> '+ valr+ '</div');
b)var valr='r';
  valr = valr,replace('r' , 't');
  $(',try').prepend('<div> '+valr+ '</div>');
c)var valr='r';
  valr = valr,replace('r' 't' , 'rt');
  $(',try').prepend('<div> '+valr+ '</div>');
d)None of these.

3)What does the method css() inJQuery do?
a)Return a style property on the first matched element.
b)Set a single style property to a value on all matched elements.
c)Set a key/value object as style properties to all matched elements.
d)All of the mentioned

4)Which JQuery method can be used to attach a function to be executed whenever an    AJAx request begins and there is none already acitve?
a)ajaxStart(callback)
b)ajaxComplete (callback)
c)ajaxSend(callback)
d)ajaxStop(callback)

5)Which of the following is teh correct way to distinguish left and right mouse click        event inJQuery?
a)event.what
b)event.which
c)event.click
d)even.whichclick

6)Which of the following is not an ajax function settings?
a)datatype
b)error
c)xml
d)password

7)Which jQuery method gets the current offset of the first matched element, in pixels,    relative to the document?
a)offset( )
b)position( )
c)offsetParent( )
d)None of the above

8)What is the correct jQuery code to set the background color of all p elements to          read?
a)$("p").manipulate("background-color","red");
b)$("p").layout("background-color","red");
c)$("p").css("background-color","red");
d)$("p").Style("background-color","red");

9)What is the correct jQuery code to set the bacjground color of all p elements ti red?
a)$("p").manipulate-color","red");
b)$("P").layout("background-color","red");
c)$("p").css(background-color","red);
d)$("p").style("background-color","red");

10)What selectoe would you use to query for all elements with an ID that ends with a        particular string,for example 'txtTitle'?
a)$("[id$='txtTitle']")
b)$("[id='%txtTitle']")
c)$("[id=$txtTitle']")
d)None of the mentioned

11)Which of the following is correct with regards to how to upload a file                              asynchronously with jQuery?
a)Tn HTML5 file can be uploaded using Ajax and jQuery, Not only that, file                                validations(name,size,MINE-type)and handling the progress event can also be done with      THE HTML5 progress tag(or a div).
b)$('#one-specific-file').aJaxfileupload({'action':'/upload.php'});
c)Ajax file uploads cannot be done.
d)$(document).ready(function(){$("#uploadbutton").jsupload({action:                                          "addFile.do",onComplete:function(response){alert("server response: "+response;}});

12)What does the event.stopPropogation() function do?
a)Bubbles up the DOM tree and stops at the closest parent element.
b)Bubbles up the DOM tree,preventing any parent handlers from being noified of the event.
c)Bubbles up the DOM and parents other handlers on the same element from running.
d)None of the above

13)Which of the following is the correct way to value of a textbox using id in jQuery?
a)$(".textbox").text()
b)$"#textbox").val()
c)$(".textbox").val()
d)$("#textbox").text()

14)Which of the following jQuery method gets the childern of each element in the set        of the matched elements?
a)childern(selector)
b)getChildern(selector)
c)getChild(selector)
d)None of the above

15)Which of the following method is used to create custom animations in JQuery?
a)Css()
b)animate()
c)animation()
d)start_animation()

16)Which jQuery method is used to perform an asynchronous HTTP request?
a)JQuery.ajaxSetup()
b)JQuery.ajaxAsync()
c)jQuery.ajex()
d)None of the mentioned

17)What's the right way to access the content of an iframe using jQuery?
a)If the <iframe> is from the same domain, the elements are easily accessible asa $("#iFrame").contents ().find("#someDiv"). removeClass("hidden");
b)$('#frametest'),HTML()
c)$('Some selector', frames['nameofMyIframe'], document).innerHTML()
d)All of the above

18)Which of the following is the correct way to get "Option 8" with the value '2' form        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>
a)$("#list[value='2']".text();
b)$("#list option [value='2']").text();
c)$(this).find("option:selected").text();
d)element.options[element.selectedIndex].text

19)Which of the following jQuery method adds the specified class if it is not present        or remove the specified class if it is present? 
a)toggleClass(Class)
b)toggleClassName(class)
c)ChangeClass(class)
d)changeClassName(class)

20)Using element of some kind that is being hidden using.hide() and shown(). Which        of the following is the best way ro determine if that element is currently hidden or        visible on the screen?
a)$(element).is(:visble")
b)$(this).css(:"invisble")=="hidden"
c)$(element).is(:invisble")
d)$(this).css("visible") =="hidden"

21)Which of the following is the correct is the way to use jQuery with node.js?
a)By including jQuery library file
b)By installing jQuery npm module 
c)By directly using jQuery without jQuery library file and jQuery npm module
d)By including jQuery library file and installing jQuery npm module

22)Which of the following makes use of jQuery to select multiple elements?
a)$('table td').eq([0, 5, 9])
b)$('table td:eq(0), table td:eq(5), table ted:eq(9)')
c)$('table td').eqAny([1, 5, 9]);
d)None of these.

23)Which of the following will make the background of a page change, upon being            refreshed/
a)$(document).redy(function() {
  vartotalCount = 2;
  var num = math.ceil(Math.random() * totalCount );
  document.body.background ='assets/baclground='+num+.jpg
  });
b)$(document).redy(function() {
  var num = math.ceil(Math.random() * totalCount );
  document.body.background ='assets/baclground='+num+.jpg
  });
c)$(document).redy(function() {
  vartotalCount = 2;
  var num = Math(Math.random() * totalCount );
  document.body.background ='assets/baclground='+num+.jpg
  });

24)Which of the following is the correct way to select <a> on the basic of href using          jQuery?
a)jQuery("a").href()
b)jQuery("a").attr("href")
c)jQurey("a[herf='url']")
d)jQuery("a attr[href='url]")

25)How can an additional row be added to a table as the last row using jQuery?
a)$('#myTable tr:end').after('<tr>......</tr><tr>.....</tr>;);
b)add_new_row('#myTable', '<tr><td>my new row</td></tr>');
c)$('#myTable > tbody:last').append('<tr>......</tr><tr>.....</tr>;);
d)$('#myTable tr:end').after('<tr>......</tr><tr>.....</tr>;);

26)What does the method jQuery.getScript() do?
a)Load a javascript file from the server using a GET HTTP request.
b)Load a javascript file from the server using a GET HTTP request, then it.
c)Load data from the server using a HTTP GET request.
d)Load data from the server and place the returned HTML into the matched element.

27)Which jQuery method retrieves all the elements contained in the jQuery set, as an        array?
a)toArray()
b)toArrayObject()
c)changeToArray()
d)changeToArray()

28)Which of the following is the correct way to move an element into another                    element?
a)$('#source').prependTo('#destination');
b)$("#source").add("#destination");
c)$("#source").html("#destination");
d)$("#source").add().html().("#destination");

29)What does the method.empty() do?
a)Removes the set of matched elements from the DOM.
b)Remove all child modes of the set of matched elements from the DOM.
c)Removes the set of matched from the Dom.
d)Removes the parents of the set of matched elements from the DOM, leaving the matched    elements in their place.

30)What does the method one() do?
a)Attach a handler to an event for the elements, the Handle is executed at most once per element per event type.
b)Attach an event handler for the elements, which match the current selector, now and in        the future.
c)Attach an event handler function for one or more events to the selected elements.
d)Attach a handler to an event for the elements.

31)Which of the following is the best way to open a  JQuery UI dialog box without a          title bar?
a)$("#ui-dialog-titlebar").hide();
b)$(".ui-dialog-titlebar").hide();
c)$("#dialog").siblings('duv#ui-dialog-titlebar').remove();
d)$(".ui-titlebar").hide();

32)Please select the correct ways of accessing the src attribute of an HTML image            element with an id of someImage:
a)var src =$('#someimage').src;
b)var src =$('#someimage')attr.('src');
c)var src =$('#someimage').get(0).src;
d)var src =$('#someimage').prop('src');

33)Which of the following is correct to remove id attribute from all H2 elements with        in the "content" class?
a)(".content h2").removeAttr("id");
b)("#content h2").removeAttrib("id");
c)(".content. h2").removeAttr("id");
d)(".content h2").removeAttrib("id");

34)Which of the following will get the first column of all tables using jQuery?
a)$('table.tblItemTemplate first-child');
b)$('table.tblITemTemplate tr:first-child');
c)$('table,tblITemTemplate td:first-child');
d)$('tabletblItemTemplate td:first-child');

35)Which of the following is the correct way to check the existance of an element in          JQuery other than the following code?
a)if($(selector). length>0) {
    //Do something}0
b)jQuery.fn.exists=function()(return this.length>0;}
   If ($(selector).exists()){//Do sometning}
c)jQuery.fn = function(){return this.length.0;} if(selector).exists()){//Do something}
d)jQuery.exists =function(selector){return ($(selector).length>0);if ($.exists(selector)){}
e)jQuery.fn.exists = function(selector){return selector?this.find(selector).length :                        this.length;}; 

36)Which jQuery function can be used to filter out elements from a set of matched            elements?
a)filter(selector)
b)applyFilter(selector) 
c)setFilter(selector)
d)None of the above

37)Which of the following is the correct way to add an additional option and select it        with jQuery?
a)$('#mySelect').opened('<option value="whatever">text</option>').val('whatever')
b)$('#myselect').html('<option value="whatever">text</option>').Val(.whatever')
c)$('#mySelect').text{'<option vaiue="whatever">text</option>').val('whatever')
d)$('#mySelector').val('whatever')


2 comments

Answer mark kora nai keno?

Balas

where are the answers ?

Balas