- 1. 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 herecontext.fillstyle = “blue”;context.font = “bold 16px Arial”;context.fillText (“Zibri”, 100, 100);</script>
<option value="89">Item 1</option>
<option value="90">Item 2</option>
Ans:a. Ctx.drawImage(img, 10, 10);5. How can an HTML5 canvas size be changed so that it fits the entire window?
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. Button9. Once an application is offline, it remains cached until the following happens (select all that apply):Ans: b. The manifest file is modified10. The following are valid use cases of client file/directory access in HTML5, except:Ans: c. Use of HTML5 File API11. The following link is placed on an HTML webpage:<a href="http://msdn.com/" target="_blank"> MSDN </a>What can be inferred from itb. 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. True13. 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-DD16. What is the limit to the length of HTML attributes?Ans: a. There is no limit17. What is the role of the <dfn> element in HTML5?Ans: b. It is used to define a definition term18. When does the ondragleave mouse event get fired in HTML5?Ans:b. It gets fired when an element leaves a valid drop target19. Which event is fired when an element loses its focus in an HTML5 document?Ans:c. Onblur20. Which following are valid default values for the <input type="date"> HTML5 element?Ans: b. 2013-05-3021. 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.Onstalled24. Which media event will be fired when a media resource element suddenly becomes empty?Ans: c. Onemptied25. 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.charset27. Which of the following are sample use cases for HTML5 web workers?Ans: d. All of these28. Which of the following are the valid values of the <a> element's target attribute in HTML5?Ans: a._blankb. _selfc. _top