Saturday 15 August 2015

upwork html5 2018 new test question and answer 100%


Signed in as Artical Writer
Time remaining: 01:46
HTML5 Test
Question 1 of 45

Which of the following is the correct way to store an object in localStorage?

var obj = { 'one': 1, 'two': 2, 'three': 3 };

localStorage.setItem('obj', obj);        ok

localStorage.setItem('obj', JSON.stringify(obj));

localStorage.setItem('testObject', JSON.parse(testObject));

localStorage.setItem(obj);

Can this question be improved?
Let us know
Continue

Signed in as Artical Writer
Time remaining: 01:51
HTML5 Test
Question 2 of 45

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?

ctx.drawImage(img,10,10);     ok

context.drawImage(img,20,10,10,10);

context.drawImage(img,10,20,10,10,20,20,10,10);

All of these

Can this question be improved?
Let us know
Continue


Signed in as Artical Writer
Time remaining: 01:46
HTML5 Test
Question 3 of 45

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

Drag and drop of files from the desktop

Full file system access

Use of the HTML5 File API     ok

Use of files as HTML5 input types

Can this question be improved?
Let us know
Continue

Signed in as Artical Writer
Time remaining: 01:55
HTML5 Test
Question 4 of 45

Can we store JavaScript Objects directly into localStorage?

Yes

No   ok

Can this question be improved?
Let us know
Continue

Signed in as Artical Writer
Time remaining: 01:57
HTML5 Test
Question 5 of 45

Which of the following is the correct way to play an audio file in HTML5?

Note: There may be more than one right answer.

var snd = new Audio("file.wav");    ok
snd.play();                                              

<audio controls>                                        
  <source src="file.ogg" type="audio/ogg">
  <source src="file.mp3" type="audio/mpeg">
</audio> ok

<source src="file.mp3" type="audio/mpeg">

All of these.

Can this question be improved?
Let us know
Continue


Signed in as Artical Writer
Time remaining: 01:32
HTML5 Test
Question 6 of 45

What does P2P streaming mean when web applications establish a P2P HTTP connection using HTML?

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

It means that streaming of a voice/video frame is first between one peer to the server then the server to another peer.

Communication does not rely on a shared relay server in the network.

Can this question be improved?
Let us know
Continue

Signed in as Artical Writer
Time remaining: 01:48
HTML5 Test
Question 7 of 45

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

Note: There may be more than one right answer.

The application cache is programmatically updated.   ok

The application cache gets automatically cleared by the browser.    ok

The manifest file is modified.    ok

The user clears their browser's data storage for the site.

Can this question be improved?
Let us know
Continue

Signed in as Artical Writer
Time remaining: 01:23
HTML5 Test
Question 8 of 45

What is the difference between Server-Sent Events (SSEs) and WebSockets in HTML5?

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

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

WebSockets and SSEs are functionally equivalent.

None of these.

Can this question be improved?
Let us know
Continue

Signed in as Artical Writer
Time remaining: 01:52
HTML5 Test
Question 9 of 45

Which HTML5 doctype declarations are correct?

Note: There may be more than one right answer.

<!doctype html>

<!DOCTYPE html>   ok

<!DOCTYPE HTML5>

<!DOCTYPE HTML> ok

Can this question be improved?
Let us know
Continue

Signed in as Artical Writer
Time remaining: 01:45
HTML5 Test
Question 10 of 45

Which of the following <section> elements have the correct attribute assignment as per HTML5?

Note: There may be more than one right answer.

<section id="example">...</section id="example">

<section id="example">...</section id="example2">

<section id="EXAMPLE">...</section>      ok

<section id="Example">...</section>

<section id="example">...</section>

Can this question be improved?
Let us know
Continue


Signed in as Artical Writer
Time remaining: 01:45
HTML5 Test
Question 11 of 45

When does the ondragleave mouse event get fired in HTML5?

It gets fired when an element has been dragged to a valid drop target.

It gets fired when an element leaves a valid drop target.     ok

It gets fired at the end of a drag operation.

It gets fired while an element is being dragged.

Can this question be improved?
Let us know
Continue

Signed in as Artical Writer
Time remaining: 01:34
HTML5 Test
Question 12 of 45

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

Note: There may be more than one right answer.

_blank   ok

_self   ok

_top   ok

_bottom

Can this question be improved?
Let us know
Continue


Signed in as Artical Writer
Time remaining: 01:48
HTML5 Test
Question 13 of 45

Which of the following are valid HTML5 elements?

Note: There may be more than one right answer.

canvas   ok

summary

aside

video

Can this question be improved?
Let us know
Continue


Signed in as Artical Writer
Time remaining: 01:38
HTML5 Test
Question 14 of 45

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

Note: There may be more than one right answer.

#myCanvas {height: 100%; width: 100%;}

<script type="text/javascript">

        function resize_canvas(){ ok b

            canvas = document.getElementById("canvas");
            if (canvas.width  < window.innerWidth)
            {
                canvas.width  = window.innerWidth;
            }

            if (canvas.height < window.innerHeight)
            {
                canvas.height = window.innerHeight;
            }
        }
    </script>

It depends upon the complexity of the canvas, and the frequency of redraws.

Calling the JavaScript getWidth() function.

Can this question be improved?
Let us know
Continue


Signed in as Artical Writer
Time remaining: 01:37
HTML5 Test
Question 15 of 45

Which of the following video file formats are currently supported by the <video> element of HTML5?

Note: There may be more than one right answer.

CCTV

MPEG 4    ok

Ogg ok

3GPP

Can this question be improved?
Let us know
Continue

Signed in as Artical Writer
Time remaining: 01:52
HTML5 Test
Question 16 of 45

True or false:

JavaScript objects can be stored directly into localStorage.

True

False ok

Can this question be improved?
Let us know
Continue

Signed in as Artical Writer
Time remaining: 01:56
HTML5 Test
Question 17 of 45

Which of the following is not a valid attribute for the <video> element in HTML5?

controls

autoplay

disabled ok

preload

Can this question be improved?
Let us know
Continue


Signed in as Artical Writer
Time remaining: 01:54
HTML5 Test
Question 18 of 45

Which of the following methods can be used to estimate page load times?

Note: There may be more than one right answer.

Using _gaq.push(['_trackPageLoadTime']) with Google Analytics.     ok

Using the Navigation Timing JavaScript API. ok

Page load times cannot be estimated.

Using built-in JavaScript methods.

Can this question be improved?
Let us know
Continue

Signed in as Artical Writer
Time remaining: 01:44
HTML5 Test
Question 19 of 45

How can audio files be played in HTML5?

var sound = new Audio("file.wav");

sound.begin();

sound.resume();

sound.start();

sound.play(); ok

Can this question be improved?
Let us know
Continue

Signed in as Artical Writer
Time remaining: 01:53
HTML5 Test
Question 20 of 45

Which of the following statements are correct with regard to the <hr> and <br> elements of HTML5?

Note: There may be more than one right answer.

The <hr> element acts in the same way as the tab key and the <br> element acts in the same way as the shift key.

The <hr> element is used to insert the horizontal line within the document and the <br> element is used to insert a single line break. ok

The <hr> element is used to put a line across the page and the <br> element acts in the same way as a return/enter key press.

Can this question be improved?
Let us know
Continue

Signed in as Artical Writer
Time remaining: 01:50
HTML5 Test
Question 21 of 45

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

An input tag button can be a reset button too.

A button tag button can be a reset button too.

An input tag button can include images as well.

A button tag can include images as well. ok

Can this question be improved?
Let us know
Continue


Signed in as Artical Writer
Time remaining: 02:00
HTML5 Test
Question 22 of 45

Which of the following statements is correct for a blockquote?

It makes the text a bit bigger for emphasizing.

It defines the start of a long quote. ok

It makes the text slightly bolder.

Can this question be improved?
Let us know
Continue


Signed in as Artical Writer
Time remaining: 01:49
HTML5 Test
Question 23 of 45

Which of the following is the correct way to store an object in a localStorage?

localStorage.setItem('testObject', JSON.stringify(testObject))    ok

localStorage.setItem('testObject', testObject)

localStorage.add('testObject', testObject)

localStorage.addItem('testObject', testObject)

Can this question be improved?
Let us know
Continue


Signed in as Artical Writer
Time remaining: 01:53
HTML5 Test
Question 24 of 45

You are writing the code for an HTML form and you want the browser to retain the form's input values. That is, if a user submits the form and presses the browser's back button, the fully populated form is displayed instead of a blank form. Which of the following HTML 5 attributes will you use?

accept

autofocus

autocomplete    ok

formtarget          

Can this question be improved?
Let us know
Continue


Signed in as Artical Writer
Time remaining: 01:46
HTML5 Test
Question 25 of 45

What is the limit to the length of HTML attributes?

65536

64

There is no limit. ok

None of these.

Can this question be improved?
Let us know
Continue


Signed in as Artical Writer
Time remaining: 01:52
HTML5 Test
Question 26 of 45

Which of the following are possible ways to make the browser automatically adds new images and discards deleted images with server-side events in HTML5?

Note: There may be more than one right answer.

Long Polling Ajax Requests

Server-sent Events   ok

WebSockets ok

JavaScript objects on the client via JSON.parse().

Can this question be improved?
Let us know
Continue


Signed in as Artical Writer
Time remaining: 01:47
HTML5 Test
Question 27 of 45

Which of the following code is used to prevent Webkit spin buttons from appearing on web pages?

input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    }

input[type=number]::-webkit-inner-spin-button,
  input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
   } ok

noindex:-o-prefocus,
   input[type=number] {
    padding-right: 1.2em;
    }

input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
   padding-right: 1.2em;
    }

Can this question be improved?
Let us know
Continue

Signed in as Artical Writer
Time remaining: 01:39
HTML5 Test
Question 28 of 45

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

Note: There may be more than one right answer.

sizes

rev ok

rel

charset ok

Can this question be improved?
Let us know
Continue

Signed in as Artical Writer
Time remaining: 01:52
HTML5 Test
Question 29 of 45

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

onstalled ok

onwaiting

onsuspend

oninvalid

Can this question be improved?
Let us know
Continue


Signed in as Artical Writer
Time remaining: 01:58
HTML5 Test
Question 30 of 45

Which of the following is the correct way to display a PDF file in the browser?

<object type="application/pdf" data="filename.pdf" width="100%" height="100%"/>  ok

<object type="application/pdf" id="filename.pdf" width="100%" height="100%"/>

<input type="application/pdf" data="filename.pdf" width="100%" height="100%"/>

<input type="application/pdf" src="filename.pdf" width="100%" height="100%"/>

Can this question be improved?
Let us know
Continue


Signed in as Artical Writer
Time remaining: 01:54
HTML5 Test
Question 31 of 45

Which of the following input element variations will show a numeric keypad in mobile browsers?

Note: There may be more than one right answer.

<input type="text" pattern="[0-9]*" />

<input type="number" /> ok

<input type="text" keyboard="numeric" />

<input type="text" keyboard="number11" />

Can this question be improved?
Let us know
Continue


Signed in as Artical Writer
Time remaining: 01:44
HTML5 Test
Question 32 of 45

Assuming that some text needs to be written on an HTML5 canvas, select a replacement for the commented line below:

<canvas id="e" width="200" height="200"></canvas>
<script>
  var canvas = document.getElementById("e");
  //insert code here
  context.fillStyle = "blue";
  context.font = "bold 16px Arial";
  context.fillText("Zibri", 100, 100);
</script>

var context = canvas.getContext();

var context = canvas.getElementById("context");

var context = canvas.getContext("2d"); ok

var context = canvas.getElementById("2d");

Can this question be improved?
Let us know
Continue


Signed in as Artical Writer
Time remaining: 01:49
HTML5 Test
Question 33 of 45

What is the internal/wire format of input type="date" in HTML5?

DD-MM-YYYY

YYYY-MM-DD ok

MM-DD-YYYY

YYYY-DD-MM

Can this question be improved?
Let us know
Continue


Signed in as Artical Writer
Time remaining: 01:56
HTML5 Test
Question 34 of 45

Which of the following is not a valid syntax for the <link> element in HTML5?

<link rel="icon" href="abc.jpg" sizes="16x16">

<link rev="stylesheet" href="abc.css" type="text/css" target="_parent">  ok

<link rel="alternate" type="application/pdf" hreflang="fr"  href="manual-fr">

Can this question be improved?
Let us know
Continue

Signed in as Artical Writer
Time remaining: 01:57
HTML5 Test
Question 35 of 45

Which of the following will detect when an HTML5 video has finished playing?

var video = document.getElementsByTagName('video')[0];
    video.onended = function(e) {
    } ok

var video = document.getElementsByTagName('video')[0];
    video.onPlayend = function(e) {
    }

var video = document.getElementsByTagName('video')[0];
    video.onPlayFinish = function(e) {
    }

var video = document.getElementsByTagName('video')[0];
    video.onPlayBackended = function(e) {
    }

Can this question be improved?
Let us know
Continue


Signed in as Artical Writer
Time remaining: 01:45
HTML5 Test
Question 36 of 45

Which of the following are valid ways to associate custom data with an HTML5 element?

Note: There may be more than one right answer.

<tr class="foo" data-id-type="4"> ok

<tr class="foo" id-type="4">

<tr class="foo" data-id_type="4"> ok

All of the above.

Can this question be improved?
Let us know
Continue


Signed in as Artical Writer
Time remaining: 02:00
HTML5 Test
Question 37 of 45

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

now

2013-05-30 ok

2013-30-05

today

Can this question be improved?
Let us know
Continue


Signed in as Artical Writer
Time remaining: 01:52
HTML5 Test
Question 38 of 45

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

toDataURL() ok

saveAsImage()

saveFile()

exportImage()

Can this question be improved?
Let us know
Continue


Signed in as Artical Writer
Time remaining: 01:25
HTML5 Test
Question 39 of 45

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

onerror

onended

onloadeddata

onemptied ok

Can this question be improved?
Let us know
Continue

Signed in as Artical Writer
Time remaining: 01:57
HTML5 Test
Question 40 of 45

Which of the following events is not supported in HTML5?

oninput

oninvalid

ondrop

onreset  ok

Can this question be improved?
Let us know
Continue

1 comment:

new logo