Wednesday, August 7, 2019

Upwork HTML5 Test Answers 2019

Upwork HTML5 Test Answers 2019

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

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

Answers:

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

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

Answers:

• #myCanvas {height: 100%; width: 100%;}
• <script type=»text/javascript»> function resize_canvas(){ 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.

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

Answers:

• WebSockets can perform bi-directional (client-server and vice versa) data transfers, while SSEs can only push data to the client/browser.• 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.

4. 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?

Answers:

• <a href=»mailto:webmaster@xcompany.com»>webmaster</a>• <a href=»webmaster@xcompany.com»>webmaster</a>
• <a http=»mail:webmaster@xcompany.com»>webmaster</a>
• <mail http=»send:webmaster@xcompany.com»>webmaster</mail>

5. Which HTML5 doctype declarations are correct?

Answers:

• <!doctype html>
• <!DOCTYPE html>• <!DOCTYPE HTML5>
• <!DOCTYPE HTML>

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

Answers:

• Drag and drop files from the desktop
• Full file system access
• Use of the HTML5 File API• Use of files as HTML5 input types

7. 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?

Answers:

• accept
• autofocus
• autocomplete• formtarget

8. True or false:

JavaScript objects can be stored directly into localStorage.

Answers:

• True
• False

9. 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);• context.drawImage(img,20,10,10,10);
• context.drawImage(img,10,20,10,10,20,20,10,10);
• All of these

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

Answers:

• It means that streaming of a voice/video frame is direct, without using any server between them.• 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.

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

Answers:

• 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.

12. 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/>• <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.

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

Answers:

• 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.• It gets fired at the end of a drag operation.
• It gets fired while an element is being dragged.

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

Answers:

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

15. Can we store JavaScript Objects directly into localStorage?

Answers:

• Yes
• No

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

Answers:

• localStorage.setItem(‘testObject’, JSON.stringify(testObject))• localStorage.setItem(‘testObject’, testObject)
• localStorage.add(‘testObject’, testObject)
• localStorage.addItem(‘testObject’, testObject)

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

Answers:

• DD-MM-YYYY
• YYYY-MM-DD• MM-DD-YYYY
• YYYY-DD-MM

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

Answers:

• context.clearRect ( x , y , w , h );• canvas.width = canvas.width;
• context.clear();
• All of these.

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

Answers:

• onerror
• onended
• onloadeddata
• onemptied

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

Answers:

• now
• 2013-05-30• 2013-30-05
• today

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

Answers:

• <input type=»text» pattern=»[0-9]*» />• <input type=»number» />
• <input type=»text» keyboard=»numeric» />
• <input type=»text» keyboard=»number11″ />

22. How can audio files be played in HTML5?

var sound = new Audio(«file.wav»);

Answers:

• sound.begin();
• sound.resume();
• sound.start();
• sound.play();

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

Answers:

• CCTV
• MPEG 4• Ogg
• 3GPP

24. What is the proper syntax for a line break tag as W3C specs defines?

Answers:

• <br>• <br/>
• <br />
• All of these.

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

Answers:

• <tr class=»foo» data-id-type=»4″>• <tr class=»foo» id-type=»4″>
• <tr class=»foo» data-id_type=»4″>
• All of the above.

26. 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)

Answers:

• autocomplete
• autofocus
• placeholder• formnovalidate

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

Answers:

• Every HTML element can have an ARIA role attribute specified.• 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.
• There is no ARIA attribute called «role».

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

Answers:

• The application cache is programmatically updated.
• The application cache gets automatically cleared by the browser.
• The manifest file is modified.
• The user clears their browser’s data storage for the site.

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

Answers:

• 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>• <source src=»file.mp3″ type=»audio/mpeg»>
• All of these.

30. 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?

Answers:

• Long Polling Ajax Requests
• Server-sent Events
• WebSockets• JavaScript objects on the client via JSON.parse().

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

Answers:

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

32. Which of the following <section> elements have the correct attribute assignment as per HTML 5.0?

Answers:

• <section id=»example»>…</section id=»example»>
• <section id=»example»>…</section id=»example2″>
• <section id=»EXAMPLE»>…</section>
• <section id=»Example»>…</section>
• <section id=»example»>…</section>

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

Answers:

• _blank
• _self
• _top
• _bottom

34. Which of the following statements regarding WebSockets is true?

Answers:

• 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.

35. 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();
• var context = canvas.getElementById(«context»);
• var context = canvas.getContext(«2d»);
• var context = canvas.getElementById(«2d»);

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

Answers:

• It is used to define important text.
• It is used to define computer code text.
• It is used to define sample computer code.
• It is used to define a definition term.

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

Answers:

• <object> <param name=»allowFullScreen» value=»true» />
• <video allowFullScreen=»true»>
• <video height=»100%» width=»100%»>
• None of these.

38. Consider 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?

Answers:

• 89
• 90
• Item 1
• Item 2

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

Answers:

• toDataURL()
• saveAsImage()
• saveFile()
• exportImage()

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

Answers:

• <link rel=»icon» href=»abc.jpg» sizes=»16×16″>
• <link rev=»stylesheet» href=»abc.css» type=»text/css» target=»_parent»>
• <link rel=»alternate» type=»application/pdf» hreflang=»fr» href=»manual-fr»>

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

Answers:

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

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

Answers:

• toDataURL
• toImageURL
• saveAsPNG
• saveAsJPEG

43. 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();
• var context = canvas.getElementById(«context»);
• var context = canvas.getContext(«2d»);
• var context = canvas.getElementById(«2d»);

44. 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]*» />
• <input type=»number» />
• <input type=»text» pattern=»\d*»/>
• <input type=»text» pattern=»number»/>

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

Answers:

• <object type=»application/pdf» data=»filename.pdf» width=»100%» height=»100%»/>
• <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%»/>

46. Which of the following is the best method to detect HTML5 Canvas support in web browsers?

Answers:

• isCanvasSupported()
• !!document.createElement(«canvas»)
• !isCanvasSupported()
• !!window.HTMLCanvasElement

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

Answers:

• onstalled
• onwaiting
• onsuspend
• oninvalid

48. Which of the following is the correct way to check browser support for WebSocket?

Answers:

• console.log(WebSocket ? ‘supported’ : ‘not supported’);
• console.log(window.WebSocket ? ‘supported’ : ‘not supported’);
• console.log(window[WebSocket] ? ‘supported’ : ‘not supported’);
• console.log(window[‘WebSocket’] ? ‘supported’ : ‘not supported’);

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

Answers:

• controls
• autoplay
• disabled
• preload

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

Answers:

• 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.

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

Answers:

• Server-Sent Events
• SVG
• Canvas
• Web Workers

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

Answers:

• play
• loop
• mute
• pause

53. True or False:

HTML5 Canvas can be used to create images.

Answers:

• True
• False

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

Answers:

• 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.
• 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.

55. 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 the same window.
• It will open the site msdn.com in a new window.
• It will open the site msdn.com in a frame below.
• It will not be clickable as it is not formed correctly.

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

Answers:

• 65536
• 64
• There is no limit.
• None of these.

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

Answers:

• foo & bar
• foo &0 bar
• foo &0; bar
• foo&&& bar

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

Answers:

• sizes
• rev
• rel
• charset

59. 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
• command
• checkbox
• radio

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

Answers:

• onfocus
• onload
• onblur
• onselect

61. What is the purpose of the <q> element in HTML5?

Answers:

• It is used to define the start of a term in a definition list.
• It is used to define attribute values for one or more columns in a table.
• It is used to define the start of a short quotation.
• It is used to define what to show browsers that do not support the ruby element.

62. Which of the following is the best method to store an array in localStorage?

Answers:

• var localStorage[names]=new Array(); localStorage.names[0]=prompt(«New member name?»);
• var names = []; names[0] = prompt(«New member name?»); localStorage[«names»] = JSON.stringify(names); var storedNames = JSON.parse(localStorage[«names»]);
• Storage.prototype.setObj = function(key, obj) { return this.setItem(key, JSON.stringify(obj)) } Storage.prototype.getObj = function(key) { return JSON.parse(this.getItem(key)) }
• localStorage.setItem(‘names_length’, names.length); localStorage.setItem(‘names_0’, names[0]); localStorage.setItem(‘names_1’, names[1]); localStorage.setItem(‘names_’ + n, names[n]);

63. What does the icon attribute of the HTML5 command tag define?

<command icon=»?»>Click Me!</command>

Answers:

• It is used to define the URL of an image to display as the command.
• It is used to define the name of the radiogroup this command belongs to.
• It is used to define if the command is checked or not.
• It is used to define if the command is available or not.

64. Which of the following methods are valid for navigating to a fragment identifier?

http://demo.com/#foo

Note: There may be more than one right answer.

Answers:

• <a name=»foo»>bar</a>;
• <a id=»foo»>bar</a>
• <div id=»foo»>bar</div>
• <div class=»foo»>bar</div>

65. Which of the following events is not supported in HTML5?

Answers:

• oninput
• oninvalid
• ondrop
• onreset

66. Which of the following are valid HTML5 elements?

Answers:

• canvas
• summary
• aside
• video

67. Which of the following is an invalid value for the type attribute of a command tag?

Answers:

• checkbox
• radio
• command
• text

68. Which of the following are true regarding the <keygen> tag in HTML5?

Answers:

• The <keygen> tag specifies a key-pair generator field used for forms.
• The <keygen> tag generates a public/private key pair and then creates a certificate request. This certificate request will be sent to a Certificate Authority (CA), which then creates a certificate and sends it back to the browser.
• The <keygen> tag generates random passwords when the user requests for a password reset.
• The <keygen> tag is deprecated in HTML5.

69. Which of the following is not an attribute of the <meta> element in HTML5?

Answers:

• charset
• content
• http-equiv
• scheme

70. Which of the following is a proper syntax for <br> tag as W3C specs for HTML5 defines?

Answers:

• <br />
• <br/>
• <br>
• <br></br>

71. Can we use SVG tags directly in HTML5 without using any plugin?

Answers:

• Yes
• No

72. How to assign multiple classes to one element?

Answers:

• <div class=»one,two,three»></div>
• <div class=»one;two;three»></div>
• <div class=»one two three»></div>
• <div class=»one» class=»two» class=»three»></div>

73. How to make an element draggable in HTML5?

Answers:

• set the draggable attribute to true as draggable=»true»
• set the movable attribute to true as movable=»true»
• set the dropable attribute to true as dropable =»true»
• You can not make an element draggable in HTML5

74. Which of the following is not a core method of WebSQL Database API?

Answers:

• openDatabase
• transaction
• executeSql
• connect

75. Which one of the following is not a valid input control in HTML5?

Answers:

• range
• url
• address
• number

76. Which element defines the title of a work (e.g. a book, a song, a movie, etc.)?

Answers:

• <details>
• <cite>
• <bdi>
• <title>

77. The HTML5 element used to draw a graphics via scripting?

Answers:

• mark
• figure
• Canvas
• figcaption

78. Which value of Socket.readyState atribute of WebSocket indicates that the connection is going through the closing handshake?

Answers:

• 0
• 1
• 2
• 3

79. How to declare HTML5 document type?

Answers:

• <!DOCTYPE html5>
• <!DOCTYPE html>
• <!DOCTYPE HTML PUBLIC «-//W3C//DTD HTML 5.00 Transitional//EN» «http://www.w3.org/TR/html5/loose.dtd»>
• <!DOCTYPE HTML PUBLIC VERSION «5.00»>

80. Is WebSQL a part of HTML5 specification?

Answers:

• Yes
• No

81. Which method is used to execute a query in WebSQL?

Answers:

• execute
• executeWebSQL
• executeSql
• executeQuery

82. Which of these statements are considered as best practices?

Answers:

• Place all CSS/JavaScript files within the <head> element
• Place all CSS/JavaScript files at the bottom of <body> element
• Place CSS files within the <head> element
• Place JavaScript files at the bottom of <body> element

83. In HTML5, drag and drop is part of the standard?

Answers:

• True
• False

84. Which of the following attribute triggers an abort event?

Answers:

• abort
• offline
• onabort
• onbeforeonload

85. Which is the following represents that the document is using HTML5?

Answers:

• <!DOCTYPE HTML PUBLIC «-//W3C//DTD HTML 4.01//EN» «http://www.w3.org/TR/html4/strict.dtd»>
• <!DOCTYPE HTML PUBLIC «-//W3C//DTD HTML 4.01 Transitional//EN» «http://www.w3.org/TR/html4/loose.dtd»>
• <!DOCTYPE html PUBLIC «-//W3C//DTD XHTML 1.0 Strict//EN» «http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd»>
• <!DOCTYPE html>

86. Which of the following is used to set the fill color for a drawing on Canvas?

Answers:

• fillStyle()
• fill()
• color()
• fillColor()

87. How do you specify where the dragged data can be dropped?

Answers:

• Setting attribute dropable = «true»
• Calling the event.preventDefault() method for the ondragover event.
• Setting attribute draggable = «true»
• Calling the event.preventDefault() method for the ondragstart event.

88. Which of the following video formats is not supported by the video tag?

Answers:

• MP4
• WebM
• Ogg
• Mov

89. Which tag is used to show subtitles in a video in HTML5?

Answers:

• track
• source
• video
• audio

90. Which methods are provided by geolocation?

Answers:

• getCurrentPosition
• watchPosition
• clearWatch
• All of the above

91. Which of the following tag can be used to associate a caption together with some embedded content in HTML5?

Answers:

• caption
• figure
• nav
• dialog

92. Which attribute specifies that the video will be loaded at page load, and ready to run. Ignored if autoplay is present.

Answers:

• poster
• loop
• preload
• src

93. Which of the following is a new input type introduced in HTML5?

Answers:

• text
• password
• email
• radio

94. How do you declare HTML5 document type?

Answers:

• <!DOCTYPE html5>
• <!DOCTYPE html>
• <!DOCTYPE HTML PUBLIC «-//W3C//DTD HTML 5.00 Transitional//EN» «http://www.w3.org/TR/html5/loose.dtd»>
• <!DOCTYPE HTML PUBLIC VERSION «5.00»>

95. Which of the following code is valid?

Answers:

• <div id=»container» class=»home-page» datasize=»960px»></div>
• <div id=»#container» class=».home-page» data-size=»960px»></div>
• <div id=»container» class=»home-page» data-size=»960px»></div>
• All of these codes are valid

96. Which tag in HTML5 can be used to define navigation links?

Answers:

• navigation
• footer
• nav
• meter

97. Which among the following tags define a caption for a fieldset element?

Answers:

• legend
• select
• input
• textarea

98. Which of the following attribute triggers event when an element gets user input?

Answers:

• oninput
• ondata
• onput
• onhaschange

99. Which of the following attributes requires you to have a value in an input control in HTML5?

Answers:

• autofoucs
• required
• placeholder
• output

100. Which of the following tags used to specify subtitles for <video>?

Answers:

• <sub>
• <title>
• <subtitle>
• <track>

101. Which tags are most commonly used by search engines?

Answers:

• Paragraph
• Heading Correct
• Title
• All of above

102. Which of the following is not a valid input type of the form tag?

Answers:

• email
• checkbox
• hidden
• video

103. What is the correct HTML5 element for playing video files?

Answers:

• <movie>
• <media>
• <video>
• All of the above

104. Why should you add alternative text to your images?

Answers:

• In case the user wishes to load a different picture
• So the users can get an idea of what the image is before it loads and it is also helpful in SEO
• So the user can save the image using the text as a name
• Just to keep your document valid

105. The way the browser displays the object can be modified by

Answers:

• attributes
• parameters
• modifiers
• None of above

106. When using video on a page, if autoplay attribute is set then which of the following attributes is ignored?

Answers:

• loop
• preload
• controls
• muted

107. What is used to continuously push events from the web server to the client’s browser?

Answers:

• Server Sent Events
• Web Workers
• AJAX
• Push Notifications

108. Which of the following is correct for embed «flash.swf» into your webpage?

Answers:

• <flashembed src=»flash.swf» height=»80″ width=»80″ />
• <SWF src=»flash.swf» height=»80″ width=»80″ />
• <embed src=»flash.swf» height=»80″ width=»80″ />
• <insert src=»flash.swf» height=»80″ width=»80″ />

109. Which of the following event occurs when the document comes online?

Answers:

• onload
• onloadstart
• onmessage
• ononline

110. Which is the recommended standard video format in HTML5?

Answers:

• Theora video and Vorbis audio, as well as the Ogg container format.
• The HTML5 specification does not specify which video and audio formats browsers should support.
• H.264/MPEG-4 AVC

111. Which method is used to fetch the current geographic location of the user and update it as the user moves?

Answers:

• getCurrentPosition()
• watchPosition()
• getContinuousPosition()
• watchContinuousPosition()

112. Which of the following input control accepts only numerical value in HTML5?

Answers:

• range
• number
• time
• week

113. How many h1 elements are recommended on a single page?

Answers:

• Unlimited.
• One per section (HTML5) or one per document (HTML4).
• Depends on the size of the page.

114. Which of the following input control is provided by HTML5 for input fields that should contain an e-mail address?

Answers:

• url
• email
• number
• email-address

115. What is the correct HTML for making a checkbox?

Answers:

• <input type=»checkbox»>
• <check>
• <input type=»check»>
• <checkbox>

116. Which of these elements are deprecated in HTML5?
Note: There may be more than one right answer.

Answers:

• <center>
• <font>
• <iframe>
• <tfoot>

117. Which of the following is a new input restriction introduced in HTML5?

Answers:

• disabled
• maxlength
• readonly
• required

118. HTML tags are used to describe document ____?

Answers:

• Image
• Content
• Definition
• Groups

119. To specify a font for your whole page add which tag?

Answers:

• < defaultfont >
• < targetfont >
• < basefont >
• < body >

120. The background image will scroll when the user scrolls down the page, unless you add which property to the body tag ?

Answers:

• bgproperties=»stationary»
• bgproperties=»fixed»
• bgproperties=»holdstill»
• bgproperties=»scroll»

121. Which of the following method is used to import external scripts?

Answers:

• import
• importScripts
• scriptsImport
• importJS

122. Which of the following creates an email address hyperlink?

Answers:

• <a href=»me@domainname.com»>Email me</a>
• <a href=»mailto:me@domainname.com»>Email me</a>
• <a href=»email:me@domainname.com»>Email me</a>
• <a href=»send:me@domainname.com»>Email me</a>

123. Which of the following features are supported by HTML5?

Answers:

• Web Sockets
• Server-Sent Events
• Persistent Local Storage
• All of the above

124. When images are used as links they get a blue border?

Answers:

• Type
• Never
• Unless border is set to zero
• Always

125. Which attribute specifies that the image is part of a server-side image-map?

Answers:

• IMAP
• SMAP
• ISMAP
• imageMap
126. Please select the correct media attributes of the style element:
Note: There may be more than one right answer.

Answers:

• all
• printscreen
• not phone and (color)
• speech and (min-device-width: 800px)

127. Which of these statements are true?
Note: There may be more than one right answer.

Answers:

• A block-level element always starts on a new line and takes up the full width available.
• An inline element does not start on a new line and only takes up as much width as necessary.
• A block-level element always starts on a new line and only takes up as much width as necessary.
• A block-level element can be placed into inline elements.

128. The default character encoding in HTML5 is?

Answers:

• UTF-16
• UTF-8
• UTF-32
• ISO-8859-1

129. Please select the correct usage of the address element:

Answers:

• <address>Last Modified: 2016/05/12 21:32:56</address>
• <footer>
<address>
Feel free to contact me at
<a href=»mailto:johns@upwork.com»>John Smith</a>.
<p<small>© copyright 2016 Upwork.</small></p>
</address>
</footer>
• <footer>
<address>
Feel free to contact me at
<a href=»mailto:johns@upwork.com»>John Smith</a>.
</address>
<p><small>© copyright 2016 Upwork.</small></p>
</footer>

130. Which of these table element does not exists?

Answers:

• <tfoot>
• <th>
• <col>
• <tcol>

131. How many tags are in a regular element?

Answers:

• 1
• 2
• 3
• 4

132. What is the right way to pass custom data to an element?

Answers:

• <div data=»{ ‘key’:’value’ }»></div>
• <div data-key=»value»></div>
• <div data_key=»value»></div>
• <div key=»value»></div>

133. Which of the following is a new form element introduced in HTML5?

Answers:

• button
• textarea
• datalist
• select

134. Which of the following is/are valid HTML5 attributes?
Note: There may be more than one right answer.

Answers:

• webgl
• spellcheck
• manualfocus
• contextmenu

135. Which HTML tag is NOT used when formatting text?

Answers:

• <img>
• <small>
• <p>
• <strong>

136. Which of these values are allowed for attribute “method” for form element?
Note: There may be more than one right answer.

Answers:

• get
• post
• patch
• delete

137. Which of these elements are block-level?
Note: There may be more than one right answer.

Answers:

• <h1> … <h6>
• <p>
• <img>
• <span>

138. What is ALT text?

Answers:

• Text displayed when you hold your mouse over an image
• Text displayed when an image is not found
• Text displayed when a user has images switched off in the browser
• All of the above

139. How do you make the content inside an element editable?

Answers:

• Setting the attribute contenteditable = «true»
• Setting the attribute editable = «true»
• Setting the attribute content = «editable»
• The content inside all the elements is editable by default in HTML5.

140. Which is the correct HTML element for making a drop-down list?

Answers:

• <list>
• <input type=»list»>
• <input type=»dropdown»>
• <select>

141. A 6 digit Hex color (#FF9966) defines values of Red, Blue and Green in which order ?

Answers:

• #BBRRGG
• #BBGGRR
• #RRGGBB
• #RRBBGG

142. Using Hspace will add what to your image?

Answers:

• Space to the left and right
• Space to the right and left
• Height to all equal
• Space to top and left

143. Which of the following is not a valid attribute for the audio element in HTML5?

Answers:

• preload
• loop
• stopped
• muted

144. The element to specify a list of predefined options for input control is

Answers:

• <source>
• <datalist>
• <tracklist>
• <optionlist>

145. Which of the following is not valid about MediaRecorder API ?

Answers:

• MediaRecorder.start() method is called to start the recording.
• MediaRecorder.process() method is called to start the recording.
• MediaRecorder API works alongside Navigator.getUserMedia() to capture media data.
• The contents of the recording will be made available in the platform’s default encoding via the dataavailable event

146. Which of the following method is used to check if the browser can play the specified audio/video type?

Answers:

• checkType
• canPlayType
• typeSupport
• mediaPlayType

147. Which of the following attributes can be specified on any HTML element?
Note: There may be more than one right answer.

Answers:

• contenteditable
• height
• id
• name
• spellcheck
• translate
• value

148. Which of the following tag is used for a multi line text input control?

Answers:

• textarea
• textml
• text
• None of the above

149. Which of the following attribute specifies whether or not a user is allowed to drag an element?

Answers:

• draggable
• context
• content
• drag

150. Which of the link types can be specified on the link elements in HTML (a, area, link)?

Note: There may be more than one right answer.

Answers:

• alternate
• text/javascript
• license
• prefetch
• image
• rss
• stylesheet

151. Which method is used to finish a launched worker?

Answers:

• endWorker
• end
• terminate
• finish

152. Which HTML5 element is used to specify a header for a document or section?

Answers:

• <section>
• <header>
• <top>
• None of the above

153. Choose the valid methods for navigating to a fragment identifier.
Note: There may be more than one right answer.

Answers:

• Parse the URL, and let fragid be the <fragment> component of the URL.
• If fragid is the empty string, then the indicated part of the document is the top of the document.
• If there is an element in the DOM that has an ID exactly equal to fragid, then the first such element in tree order is the indicated part of the document; stop the algorithm here.
• If there is an a element in the DOM that has a name attribute whose value is smilar to fragid, then the first such element in tree order is the indicated part of the document; stop the algorithm here.

154. The HTML <marquee> tag supports the following attributes?
Note: There may be more than one right answer.

Answers:

• rgbcolor
• behavior
• direction
• delayscroll
• loop

155. Text styles, The following properties control how text is laid out?
Note: There may be more than one right answer.

Answers:

• CanvasRenderingContext2D.move
• CanvasRenderingContext2D.textAlign
• CanvasRenderingContext2D.lineDraw
• CanvasRenderingContext2D.font
• CanvasRenderingContext2D.textBaseline

156. The <body> tag has following attributes which can be used to set different colors?
Note: There may be more than one right answer.

Answers:

• bgcolor
• text
• alink
• hlinks
• All of the above

157. What is the correct HTML for making a text input field?

Answers:

• <input type=»textfield»>
• <input type=»text»>
• <textinput type=»text»>
• <textfield>

158. Line styles, There are several properties which allow us to style lines include the following?
Note: There may be more than one right answer.

Answers:

• lineDashOffset: Specifies where to start a dash array on a line
• miterLimit: Sets the appearance of the ends of lines
• lineWidth: Sets the width of lines drawn in the future
• lineCap: Sets the current line dash pattern
• lineJoin: Sets the appearance of the «corners» where lines meet

159. There are following different methods to set colors in your web page?
Note: There may be more than one right answer.

Answers:

• Color digit
• Color names
• Hex codes
• Color decimal
• Percentage values

160. In drawing text, the canvas rendering context provides the following methods to render the text?
Note: There may be more than one right answer.

Answers:

• fillText(text, x, y [, maxWidth])
• fillText(text, x, y {maxWidth})
• strokeText(text, x, y {maxWidth})
• strokeText(text, x, y [, maxWidth])

161. Getting images to draw the canvas API is able to use any of the following data types as an image source?
Note: There may be more than one right answer.

Answers:

• HTMLCanvasElement
• HTMLVideoElement
• HTMLImageElement
• None of the above

162. Which HTML element is used to make a dropdown selection with options divided to sections?

Answers:

• option
• section
• optionSection
• optgroup

163. How many heading levels can be created with HTML tags?

Answers:

• 1
• 2
• 4
• 6
• 8
• As many as needed

164. How can you add custom text on a browser’s tab?

Answers:

• Add title tag to the body of HTML document
• Add title tag to the head of HTML document
• Add name tag to the head of HTML document
• Add meta tag to the head of HTML document with `name=»title»` and `content=»custom text»`

165. What is HTML?

Answers:

• Programming language
• Markup language
• Scripting language
• Document model

166. How many input elements can get automatic focus after page load?

Answers:

• Can not be done without JavaScript
• 1
• 0
• As many as needed

167. Select the valid HTML elements that can embed content to an HTML document. (choose all that apply)
Note: There may be more than one right answer.

Answers:

• canvas
• image
• math
• mark

168. Which method cancels an ongoing watchPosition call?

Answers:

• geolocation.getCurrentPosition()
• geolocation.clear(); 
• geolocation.clearWatch() 
• geolocation.delete();

169. Which of the following are important attributes which can be used with <embed> tag? (choose all that apply)
Note: There may be more than one right answer.

Answers:

• hide
• autoplay
• align
• name
• loop

170. The <basefont> element is supposed to set a default font , , and typeface?
Note: There may be more than one right answer.

Answers:

• size
• color
• family
• id

171. Drawing rectangles, There are following methods that immediately draw rectangles to the bitmap?
Note: There may be more than one right answer.

Answers:

• CanvasRenderingContext2D.strokeRect()
• CanvasContext2D.strokeRect()
• CanvasRenderingContext2D.clearRect()
• CanvasContext2D.fillRect()
• CanvasRenderingContext2D.fillRect()

172. Phrase elements add structural information to text fragments as the following?
Note: There may be more than one right answer.

Answers:

• <abr>
• <acronym>
• <dfn>
• <kb>
• <samp>

173. Which of the following are Basic animation steps you need to take the draw a frame?
Note: There may be more than one right answer.

Answers:

• Restore the canvase state
• Save the canvas state
• Load the canvas
• Draw animated shapes
• All of the above

174. The following methods can be used to manipulate paths of objects?
Note: There may be more than one right answer.

Answers:

• CanvasRenderingContext2d.bezierCurveTo()
• CanvasRenderingContext2d.quadraticCurveTo()
• CanvasRenderingContext2d.line()
• CanvasRenderingContext2d.rectangle()
• CanvasRenderingContext2d.beginPath()

175. Which of the following code will play an audio in a loop?

Answers:

• audio = new Audio(‘asound.ogg’); 
audio.addEventListener(‘ended’, function() {
this.currentTime = 0;
this.play();
}, false);
audio.play();
• audio = new Audio(‘someSound.ogg’); 
if (typeof audio.loop == ‘boolean’)
{
audio.loop = true;
}
else
{
audio.addEventListener(‘loop’, function() {
this.currentTime = 1;
this.autoplay();
}, false);
}
audio.play();
• audio = new Audio(‘asound.ogg’); 
audio.addEventListener(‘loop’, function() {
this.currentTime = 1;
this.autoplay();
}, true);
audio.play();
• All of the above

176. The border-width property is used to control the width of a ____?

Answers:

• Div
• Page
• Border
• Table
• Form

177. Which of the following statement is correct about Server-Side image maps?

Answers:

• This is enabled by the ismap attribute of the <img> tag and requires access to a server and related image-map processing applications
• This is created with the usemap attribute of the <img> tag, along with corresponding <map> and <div> tags
• This is created with the image attribute of the <img>, along with corresponding image <map> and data <area>
• None of the above

178. What is the correct HTML for adding a background color?

Answers:

• <background>red</background>
• <body bg=»red»>
• <body style=»background-color:red;»>
• <body background-color=»red»>

179. Controlling the position of elements, ___ positions the element in relation to its containing element?

Answers:

• Normal
• Relative
• Absolute
• None

180. The following core attributes that can be used on the majority of HTML elements?
Note: There may be more than one right answer.

Answers:

• Class
• Id
• Title
• Style
• None of the above

181. What is the correct HTML element for the biggest heading?

Answers:

• <h6>
• <h1>
• <head>
• <heading>