Showing posts with label HTML5 Upwork (oDesk) TEST ANSWERS 2016. Show all posts
Showing posts with label HTML5 Upwork (oDesk) TEST ANSWERS 2016. Show all posts

HTML5 Upwork (oDesk) TEST ANSWERS 2016

HTML5 Upwork (oDesk) TEST ANSWERS 2016

Question:    Which of the following is the best method to detect HTML5 Canvas support in web browsers?
Answers:     !!window.HTMLCanvasElement

Question:    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>
Answers:     var context = canvas.getContext("2d");

Question:    Which event is fired when an element loses its focus in an HTML5 document?
Answers:     onblur

Question:    Which of the following examples contain invalid implementations of the ampersand character in HTML5?
Answers:     foo &0; bar

Question:    Which of the following is the correct way to store an object in a localStorage?
Answers:     localStorage.setItem('testObject', JSON.stringify(testObject))

Question:    Which of the following shows correct use of client-side data validation in HTML5, on username and password fields in particular?
Answers:     <input name="username" required /> <input name="pass" type="password" required/>

Question:    Which of the following will detect when an HTML5 video has finished playing?
Answers:     var video = document.getElementsByTagName('video')[0]; video.onended = function(e) { }

Question:    Which of the following is the best method to store an array in localStorage?
Answers:     var names = []; names[0] = prompt("New member name?"); localStorage["names"] = JSON.stringify(names); var storedNames = JSON.parse(localStorage["names"]);

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

Question:    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>
Answers:     button

Question:    Which of the following are the valid values of the <a> element's target attribute in HTML5?
Answers:     "_blank" or "_self" or "_top"

Question:    Which of the following will restrict an input element to accept only numerical values in a text field?
Answers:     <input type="text" pattern="[0-9]*" />

Question:    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?
Answers:     ctx.drawImage(img,10,10);

Question:    Once an application is offline, it remains cached until the following happens (select all that apply):
Answers:     The manifest file is modified.

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

Question:    What is the internal/wire format of input type="date" in HTML5?
Answers:     YYYY-MM-DD

Question:    Which of the following is a possible way to get fullscreen video played from the browser using HTML5?
Answers:     <video height="100%" width="100%">

Question:    Which of the following video file formats are currently supported by the <video> element of HTML5?
Answers:     MPEG 4 and Ogg