Wednesday, August 5, 2015

correct html5 upwork test answers (2015-2016)


>>All Html5 Upwork test Answers list



all upwork test answers of html5 | PHP5 | CSS3 | java | Android
all upwork test answers of html5 | PHP5 | CSS3 | java | Android




Which method of the HTMLCanvasElement is used to represent an image of a canvas element?



  • toDataURL (ans)

  • toImageURL
  • saveAsPNG
  • saveAsJPEG



Which of the following are true about the ARIA role attribute in HTML5?



  • Every HTML element can have an ARIA role attribute specified. (ans)
  • Every HTML element is required have an ARIA role attribute specified.

  • The attribute must have a value that is a set of space-separated tokens representing the various WAI-ARIA roles that the element belongs to. (ans)

  • There is no ARIA attribute called “role”.



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


localStorage.setItem(‘testObject’, JSON.stringify(testObject)) (ans)

localStorage.setItem(‘testObject’, testObject)
localStorage.add(‘testObject’, testObject)
localStorage.addItem(‘testObject’, testObject)


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


Polling URLs in background
Syntax highlighting without blocking code editing capabilities in online IDEs
Motion tracking input in realtime with a video element

All of these. (ans)




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);

localStorage.setItem(‘obj’, JSON.stringify(obj)); (ans)

localStorage.setItem(‘testObject’, JSON.parse(testObject));
localStorage.setItem(obj);


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%”/> (ans)

<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%”/>


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


var snd = new Audio(“file.wav”); snd.play();

<audio controls> <source src=”file.ogg” type=”audio/ogg”> <source src=”file.mp3″ type=”audio/mpeg”> </audio> (ans)

<source src=”file.mp3″ type=”audio/mpeg”>
All of these.



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


<tr class=”foo” data-id-type=”4″> (ans)
<tr class=”foo” id-type=”4″>
<tr class=”foo” data-id_type=”4″> (ans)
All of the above.

Which of the following examples contain invalid implementations of the ampersand character in HTML5?


foo & bar
foo &0 bar
foo &0; bar (ans)
foo&&& bar


Which of the following HTML5 features is capable of taking a screenshot of a web page?


Server-Sent Events
SVG
Canvas (ans)
Web Workers


Which of the following will restrict an input element to accept only numerical values in a text field?


<input type=”text” pattern=”[0-9]*” /> (ans)
<input type=”number” />
<input type=”text” pattern=”\d*”/>
<input type=”text” pattern=”number”/>

Which of the following is a possible way to get fullscreen video played from the browser using HTML5?


<object> <param name=”allowFullScreen” value=”true” />
<video allowFullScreen=”true”>
<video height=”100%” width=”100%”> (ans)
None of these.



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


Using _gaq.push([‘_trackPageLoadTime’]) with Google Analytics. (ans)
Using the Navigation Timing JavaScript API. (ans)
Page load times cannot be estimated.
Using built-in JavaScript methods.


Which of the following shows correct use of client-side data validation in HTML5, on username and password fields in particular?


<input name=”username” required /> <input name=”pass” type=”password” required/> (ans)
<input name=”username” validate=”true”/> <input name=”pass” type=”password” validate=”true”/>
<input name=”username” validate/> <input name=”pass” type=”password” validate/>
There is no way to implement client-side validation for the username and password fields in HTML5.

Which of the following video tag attributes are invalid in HTML5?


play
loop
mute
pause (ans)

 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 …


accept
autofocus
autocomplete (ans)
formtarget



Which of the following statements regarding WebSockets is true?


It communicates with the server with only the data required by the application.
It lowers the latency of connections for interactive web applications.
It scales better and consumes less server resources than HTTP AJAX/long-poll.
All of the above. (ans)


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


CCTV
MPEG 4 (ans)
Ogg (ans)
3GPP


You want to create a link for your website allowing users to email the webmaster. How will you implement this if the webmaster’s email address is webmaster@xcompany.com?


<a href=”mailto:webmaster@xcompany.com”>webmaster</a> (ans)
<a href=”webmaster@xcompany.com”>webmaster</a>
<a http=”mail:webmaster@xcompany.com”>webmaster</a>
<mail http=”send:webmaster@xcompany.com”>webmaster</mail>


Which of the following attributes gets hidden when the user clicks on the element that it modifies? (Eg. hint text inside the fields of web forms)


autocomplete
autofocus
placeholder (ans)
formnovalidate


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


var video = document.getElementsByTagName(‘video’)[0]; video.onended = function(e) { } (ans)
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) { }



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


controls
autoplay
disabled (ans)
preload

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; } (ans)
noindex:-o-prefocus, input[type=number] { padding-right: 1.2em; }
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; padding-right: 1.2em; }

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. (ans)
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.



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


size
rev (ans)
rel
charset (ans)

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


_blank (ans)
_self (ans)
_top (ans)
_bottom



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


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. (ans)
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.

No comments:

HTML5 Upwork (oDesk) TEST ANSWERS 2022

HTML5 Upwork (oDesk) TEST ANSWERS 2022 Question: Which of the following is the best method to detect HTML5 Canvas support in web br...

Disqus for upwork test answers