oDesk HTML 5 Test Answers 2014

Hi, Today I am sharing with you oDesk HTML 5 Test Answers 2014. There are all information is correct.
So, Friends enjoy this post and if you have another information about this test answer.
Please post a comment and share your experience with us.
  1. 1.       Assuming that some text needs to be written on an HTML5 canvas, select a replacement for the commented line below:
  2. <canvas id=”e” width=”200” height=”200”></canvas>
         Var canvas = document.getElementById(“e”);
         //insert code here
         context.fillstyle = “blue”;
         context.font = “bold 16px Arial”;
         context.fillText (“Zibri”, 100, 100);
    Ans: c. var context = canvas.getContext(“2d”);

    2.       Can we store JavaScript Objects directly into localStorage?

    Ans: b. No

    3.       For the following items of a <select> list:
    <option value="89">Item 1</option>
    <option value="90">Item 2</option>
    Which of the following values would be passed on by clicking the submit button on selecting Item 2 from the list?

    Ans: b. 90

    4.       Consider the following javascript code:
    var c=document.getElementById(“myCanvas”);
    var ctx=c.getcontext(“2d”);
    var img=document.getElementById(“img”);

    Which method will correctly draw an image in the  x=10, y=10 position?

    Ans:a.       Ctx.drawImage(img, 10, 10);

    5.       How can an HTML5 canvas size be changed so that it fits the entire window?

    Ans: b. <script type=”text/javascript”>
                  function resize_canvas() {
                           canvas = document.gatElementById(“”canvas);
                          if (canvas.width < window.innerWidth)
                               Canvas.width = window.innerWidth;
                         if (canvas.height < window.innerHeight)
                               Canvas. height = window.innerHeight;

    6.       How can audio files be played in HTML5? 
    var sound = new Audio("file.wav");
    Ans: d. Sound.play();

    7.       How does a button created by the <button> tag differ from the one created by an <input> tag?

    Ans: d. A button tag can include images as well.

    8.       In HTML5, which of the following is not a valid value for the type attribute when used with the <command> tag shown below?  <command type="?">Click Me!</command>

    Ans: a.       Button

    9.       Once an application is offline, it remains cached until the following happens (select all that apply):

    Ans: b.       The manifest file is modified

    10.   The following are valid use cases of client file/directory access in HTML5, except:

    Ans: c.        Use of HTML5 File API

    11.   The following link is placed on an HTML webpage: 
    <a href="http://msdn.com/" target="_blank"> MSDN </a> 
    What can be inferred from it
    b. It will open the site msdn.com in a new window.

    12.   True or False:
    HTML5 Canvas can be used to create images.

    Ans: a. True

    13.   What does p2p streaming mean when web applications establish a p2p HTTP connection using HTML?

    Ans: a. It means that streaming of a voice/video frame is direct, without using any server between them.

    14.   What is the difference between server-sent Events (SSEs) and websockets in HTML?

    Ans: a. Websockets can perform bi-directional (client-server and  vice versa) data transfers, while SSEs can only push data to the client/browser.

    15.   What is the internal/wire format of input type=”date” in HTML5?

    Ans: a. YYYY-MM-DD

    16.   What is the limit to the length of HTML attributes?

    Ans: a. There is no limit

    17.    What is the role of the <dfn> element in HTML5?

    Ans: b. It is used to define a definition term

    18.    When does the ondragleave mouse event get fired in HTML5?

    Ans:b.  It gets fired when an element leaves a valid drop target

    19.    Which event is fired when an element loses its focus in an HTML5 document?

    Ans:c. Onblur

    20.    Which following are valid default values for the <input type="date"> HTML5 element?

    Ans: b. 2013-05-30

    21.    Which HTML5 doctype declarations are correct?

    Ans: c. <!DOCTYPE html>

    22.    Which is the standard method for clearing a canvas?

    Ans: a. context.clearRect ( x, y, w, h);

    23.    Which media event is triggered when there is an error in fetching media data in HTML5?

    Ans: a.Onstalled

    24.    Which media event will be fired when a media resource element suddenly becomes empty?

    Ans: c. Onemptied

    25.    Which method of HTMLCanvasElement is used to represent image of Canvas Element?

    Ans: a. toDataURL()

    26.    Which of the following <link> attributes are not supported in HTML5?

    Ans: a. Rev,  d.charset

    27.    Which of the following are sample use cases for HTML5 web workers?

    Ans: d. All of these

    28.   Which of the following are the valid values of the <a> element's target  attribute in HTML5?

    Ans: a._blank
               b. _self
               c. _top