Mootools MCQs

Mootools MCQs

These Mootools multiple-choice questions and their answers will help you strengthen your grip on the subject of Mootools. You can prepare for an upcoming exam or job interview with these 70+ Mootools MCQs.
So scroll down and start answering.

1: Consider the following code snippet:
    var a = $arguments(1);
    alert(a("a","b","c"));
What does the alert box display?

A.   a

B.   b

C.   c

D.   There is no alert box. 

2: What does e1.grab(e2, "top"); do?

A.   Make e2 the first child of e1.

B.   Make e1 the first child of e2.

C.   Replace e1 by e2.

D.   Replace e2 by e1.

3: Fill in the blank with the correct word:
Function.attempt function tries to execute a number of functions. Returns immediately the return value of the first ___ function without executing successive functions, or null.

A.   true

B.   false

C.   failed

D.   non-failed

4: What does the statement "moo tools".contains("t", " "); return?

A.   true

B.   false

C.   null

D.   b

5: Which of the following code snippets defines a class?

A.   classA = new Class({x: 10});

B.   Class classA {x: 10}

C.   classA = Class.create({x: 10});

D.   classA = Class.new({x: 10});

6: What does the following do?
    request.put({name: "mootools"});

A.   Set request option value.

B.   Add array to request object.

C.   Send request as "put" method.

D.   This statement is invalid.

7: Which method(s) below is valid request method(s)?

A.   send

B.   POST

C.   post

D.   Post

8: What does Asset.image do?

A.   Load the image, and insert it at the beginning of the document.

B.   Load the image, and insert it at the end of the document.

C.   Load the image, but do not insert into the document.

D.   Get the id of the image 

9: Fill in the blank with the correct word:
The onComplete event is fired if the request ___.

A.   success or failure

B.   is canceled

C.   failure

D.   failure or is canceled

10: What is a valid value of $("e1").getStyle("width");?

A.   300

B.   300px

C.   300pt

D.   300em

11: Which of the following methods removes an element from a Hash object?

A.   remove

B.   delete

C.   erase

D.   pop

12:

Fill in the blank with the correct words:
getRandom(); will get a random ___ from the ___.

A.   element, array

B.   word, string

C.   letter, string

D.   number, range

13: Which of the following is a valid mootools table class?

A.   Table

B.   TABLE

C.   HtmlTable

D.   HTMLTABLE

14: What does request.delete({name: "mootools"}); do?

A.   Delete request option value.

B.   Remove array element from request object.

C.   Send request as

D.   This statement is invalid

15: Consider the following code snippet:
    String.implement({log: function(){console.log(this)}});
What does this code snippet do?

A.   It adds log function to predefined JavaScript String class.

B.   It adds log function to user's String class.

C.   It adds log function to String object.

D.   It runs implement function of String object as another function.

16: Consider the following code snippet:
    var a = Function.from(1.1);
    alert(a(10));
Which of the following does the alert box display?

A.   1

B.   1.1

C.   11

D.   There is no alert box.

17: Which of the following methods can you use to make an element draggable?

A.   makeDraggable

B.   draggable(true)

C.   makeDroppable

D.   droppable(true)

18: Which function can be used to remove an attribute of an element?

A.   erase

B.   remove

C.   delete

D.   cut

19: Fill in the blank with the correct word:
Implements is similar to Extends, except that it adopts properties from one or more other classes ___ inheritance

A.   without

B.   with

20: Consider the following code snippet:
    alert(1.1.floor());
Which of the following is displayed in the alert box?

A.   1

B.   2

C.   null

D.   There is no alert box. 

21: getSize() method returns width and height of an element, which value is counted in the height of the return value of getSize() function?

A.   content area height

B.   padding top and bottom

C.   margin top and bottom

D.   border top width and border bottom width

22: Consider the following code snippet:
    var a = ["1", "2", "3"];
    var b = 4;
    a.include(b);
What is the result of a?

A.   ['1', '2', '3', 4]

B.   ['1', '2', '3', '4']

C.   [1, 2, 3, 4]

D.   This code snippet is invalid

23: Complete the sentence with the correct option.
A class can inherit other class by using ___ property.

A.   Extends

B.   extends

C.   Inherits

D.   inherits

24:

Fill in the blank with the correct option.
The ___ function will be executed each time an instance of a class is created.

A.   initialize()

B.   create()

C.   new()

D.   construct 

25: Which of the following methods can you use to apply a collection of styles to an element?

A.   setStyle

B.   setStyles

C.   applyStyle

D.   applyStyles

A.   var a1 = $('a1'); a1.href="http://www.google.com";

B.   var a1 = $('a1'); a1["href"]="http://www.google.com";

C.   a and b.

D.   None of above. 

27: What does e1.inject(e2); do?

A.   Make e1 the last element of e2

B.   Make e1 the first element of e2

C.   Make e2 the last element of e1

D.   Make e2 the first element of e1 

28: Is Fx.Morph class allows you to execute animation of more than one property at the same time?

A.   Yes

B.   No 

29: What does the following code snippet do?     var img1 = new Element("img", {src:"img1.png"});

A.   Create an image element and show it at the end of the document.

B.   Create an image element and show it at the top of the document.

C.   Create an image element object.

D.   Create a collection of existing image elements.

30: Consider the following code snippet:
    function function1 () {
        var a = document.getElementById();
        return a;
    }
    alert(function1.attempt());
What does the alert box display?

A.   null

B.   true

C.   false

D.   There is no alert box 

31: Consider the following: $("id1").load("data"): What does the code snippet do?

A.   Load data from "data" page to id1 element.

B.   Load data from function "data".

C.   Load value from "data" variable.

D.   Load id1 element content into

32: Which of the following classes can you use to create sortable elements?

A.   Sortables

B.   Orderables

C.   Effects

D.   Movables

33: Which of the following statements change the background color of id1 element to yellow?

A.   $('id1').setStyle('background-color', 'yellow');

B.   document.getElementById('id1').setStyle('background-color', 'yellow');

C.   $('id1').set('background-color', 'yellow');

D.   a and b

E.   b and c

34: Fill in the blank with the correct word:
JSON.encode function converts any ___ into a JSON string.

A.   object or array

B.   class

C.   string

D.   class or string

35: Assume that c1 element is the child of p1 element, how many times is the mouseenter event fired if the mouse moves from outside to p1 element, then over the c1 element?

A.   1

B.   2

C.   3

D.   4 

36: What is the valid direction of Fx.Slide?

A.   Horizontal up

B.   Horizontal down

C.   Vertical left

D.   Vertical right 

37: Consider the following code snippet:
    var arr1 = {a1: 8, a2: 7};
    var arr2 = {a3: 6, a4: 5};
    var arr3 = {a1: 4, a3: 3};
    var arr4 = $merge(arr1, arr2, arr3);
Which of the following is the value of arr4?

A.   {a1: 8, a2: 7, a3: 6, a4: 5, a1: 4, a3: 3}

B.   {a1: 4, a2: 7, a3: 3, a4: 5}

C.   {a2: 7, a3: 6}

D.   {} 

38: Fill in the blank with the correct value:
The maximum number of arguments of onSuccess event of Request.HTML is ___.

A.   1

B.   2

C.   3

D.   4

39: Which method below inserts css class to an element?

A.   addClass

B.   toggleClass

C.   insertClass

D.   injectClass 

40: Consider the body of a document below:
    

This is «p»This is mootools«/p»mootools too


    

This is mootools


    

This is Mootools


    
What does the alert box display?

A.   1

B.   2

C.   3

D.   4 

41: Consider the following code snippet:
    new Fx.Tween($("id1")).start("opacity", 0, 1);
Does the transition happen if the current opacity value of id1 element is 1?

A.   Yes

B.   No

42: scrollTo(x, y) scrolls the element to the specified coordinated (if the element has an overflow). What is x?

A.   x is the vertical coordinate of window.

B.   x is the horizontal coordinate of window.

C.   x is the vertical coordinate of element.

D.   x is the horizontal coordinate of element. 

43: Consider the following code snippet:
    var rq1 = new Request("request1"});
    var rq2 = new Request("request2");
    var rq3 = new Request("request3");
    var group = new Group(rq1, rq2, rq3);
    group.addEvent("onComplete", function(){
        alert("Finished");
    });
    rq1.request();
    rq2.request();
    rq3.request();
When will the alert box be displayed?

A.   All three requests finish.

B.   Each request finishes.

C.   rq1 finishes.

D.   rq3 finishes.

44: What does Swiff class do?

A.   Create and return a Flash object.

B.   Create and show a Flash object on the document.

C.   Create and return a Java Aplet object.

D.   Create and return a Java Aplet object. 

45: What is the result of- alert($defined("«body»"));?

A.   true

B.   false

C.   null

D.   undefined

46: Fill in the blank with the correct option:
By default, the class Tips use the element's ___ to display tooltip.


A.   rel and tip attributes

B.   description attribute

C.   title attribute

D.   title and description attributes 

47: Consider the following code snippet:
    fx = new Fx.Tween($("id1"), {
        onComplete: function() {
            alert("Finish");
        }
    });
    fx.set("opacity", 0.5);
Does the onComplete event of fx fire after the opacity of id1 element is changed to 0.5 by the above-mentioned code?

A.   Yes

B.   No

48: What does the code snippet do?
e1.cloneEvents(e2);

A.   e1 element clones all events from e2 element.

B.   e2 element clones all events from e1 element.

C.   Duplicate event name e2 of e1 element.

D.   Duplicate event name e1 of e2 element. 

49: Consider the following code snippet:
    var global = 1;
    var a = new Chain();
    a.chain(
        function(){ global++;},
        function(){ global++;}
    );
    a.callChain();
    a.callChain();
What is the result of this code snippet?

A.   1

B.   2

C.   3

D.   4 

A.   Cookie.dispose

B.   Cookie.delete

C.   Cookie.remove

D.   Cookie.emptyÂ