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

Answers:

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

2. 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:

  1. var context = canvas.getContext();
  2. var context = canvas.getElementById(“context”);
  3. var context = canvas.getContext(“2d”);
  4. var context = canvas.getElementById(“2d”);

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

Answers:

  1. It is used to define important text.
  2. It is used to define computer code text.
  3. It is used to define sample computer code.
  4. It is used to define a definition term.

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

Answers:

  1. <object> <param name=”allowFullScreen” value=”true” />
  2. <video allowFullScreen=”true”>
  3. <video height=”100%” width=”100%”>
  4. None of these.

5. 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:

  1. 89
  2. 90
  3. Item 1
  4. Item 2

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

Answers:

  1. Drag and drop files from the desktop
  2. Full file system access
  3. Use of the HTML5 File API
  4. Use of files as HTML5 input types

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

Answers:

  1. _blank
  2. _self
  3. _top
  4. _bottom

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

Answers:

  1. An input tag button can be a reset button too.
  2. A button tag button can be a reset button too.
  3. An input tag button can include images as well.
  4. A button tag can include images as well.

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

Answers:

  1. toDataURL()
  2. saveAsImage()
  3. saveFile()
  4. exportImage()

10. Can we store JavaScript Objects directly into localStorage?

Answers:

  1. Yes
  2. No

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

Answers:

  1. It gets fired when an element has been dragged to a valid drop target.
  2. It gets fired when an element leaves a valid drop target.
  3. It gets fired at the end of a drag operation.
  4. It gets fired while an element is being dragged.

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

Answers:

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

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

Answers:

  1. DD-MM-YYYY
  2. YYYY-MM-DD
  3. MM-DD-YYYY
  4. YYYY-DD-MM

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

Answers:

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

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

Answers:

  1. It means that streaming of a voice/video frame is direct, without using any server between them.
  2. It means that streaming of a voice/video frame is first between one peer to the server then the server to another peer.
  3. Communication does not rely on a shared relay server in the network.

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

Answers:

  1. var video = document.getElementsByTagName(‘video’)[0]; video.onended = function(e) { }
  2. var video = document.getElementsByTagName(‘video’)[0]; video.onPlayend = function(e) { }
  3. var video = document.getElementsByTagName(‘video’)[0]; video.onPlayFinish = function(e) { }
  4. var video = document.getElementsByTagName(‘video’)[0]; video.onPlayBackended = function(e) { }

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

Answers:

  1. WebSockets can perform bi-directional (client-server and vice versa) data transfers, while SSEs can only push data to the client/browser.
  2. SSEs can perform bi-directional (client-server and vice versa) data transfers, while WebSockets can only push data to the client/browser.
  3. WebSockets and SSEs are functionally equivalent.
  4. None of these.

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

Answers:

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

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

Answers:

  1. <tr class=”foo” data-id-type=”4″>
  2. <tr class=”foo” id-type=”4″>
  3. <tr class=”foo” data-id_type=”4″>
  4. All of the above.

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

Answers:

  1. #myCanvas {height: 100%; width: 100%;}
  2. <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>
  3. It depends upon the complexity of the canvas, and the frequency of redraws.
  4. Calling the JavaScript getWidth() function.

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

Answers:

  1. toDataURL
  2. toImageURL
  3. saveAsPNG
  4. saveAsJPEG

22. Which of the following is the correct way to store an object in localStorage?var obj = { ‘one’: 1, ‘two’: 2, ‘three’: 3 };

Answers:

  1. localStorage.setItem(‘obj’, obj);
  2. localStorage.setItem(‘obj’, JSON.stringify(obj));
  3. localStorage.setItem(‘testObject’, JSON.parse(testObject));
  4. localStorage.setItem(obj);

23. 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:

  1. var context = canvas.getContext();
  2. var context = canvas.getElementById(“context”);
  3. var context = canvas.getContext(“2d”);
  4. var context = canvas.getElementById(“2d”);

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

Answers:

  1. input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }
  2. input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
  3. noindex:-o-prefocus, input[type=number] { padding-right: 1.2em; }
  4. input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; padding-right: 1.2em; }

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

Answers:

  1. <input type=”text” pattern=”[0-9]*” />
  2. <input type=”number” />
  3. <input type=”text” pattern=”d*”/>
  4. <input type=”text” pattern=”number”/>

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

Answers:

  1. <object type=”application/pdf” data=”filename.pdf” width=”100%” height=”100%”/>
  2. <object type=”application/pdf” id=”filename.pdf” width=”100%” height=”100%”/>
  3. <input type=”application/pdf” data=”filename.pdf” width=”100%” height=”100%”/>
  4. <input type=”application/pdf” src=”filename.pdf” width=”100%” height=”100%”/>

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

Answers:

  1. isCanvasSupported()
  2. !!document.createElement(“canvas”)
  3. !isCanvasSupported()
  4. !!window.HTMLCanvasElement

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

Answers:

  1. onstalled
  2. onwaiting
  3. onsuspend
  4. oninvalid

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

Answers:

  1. console.log(WebSocket ? ‘supported’ : ‘not supported’);
  2. console.log(window.WebSocket ? ‘supported’ : ‘not supported’);
  3. console.log(window[WebSocket] ? ‘supported’ : ‘not supported’);
  4. console.log(window[‘WebSocket’] ? ‘supported’ : ‘not supported’);

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

Answers:

  1. CCTV
  2. MPEG 4
  3. Ogg
  4. 3GPP

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

Answers:

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

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

Answers:

  1. controls
  2. autoplay
  3. disabled
  4. preload

33. 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:

  1. ctx.drawImage(img,10,10);
  2. context.drawImage(img,20,10,10,10);
  3. context.drawImage(img,10,20,10,10,20,20,10,10);
  4. All of these

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

Answers:

  1. localStorage.setItem(‘testObject’, JSON.stringify(testObject))
  2. localStorage.setItem(‘testObject’, testObject)
  3. localStorage.add(‘testObject’, testObject)
  4. localStorage.addItem(‘testObject’, testObject)

35. How can audio files be played in HTML5?

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

Answers:

  1. sound.begin();
  2. sound.resume();
  3. sound.start();
  4. sound.play();

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

Answers:

  1. var snd = new Audio(“file.wav”); snd.play();
  2. <audio controls> <source src=”file.ogg” type=”audio/ogg”> <source src=”file.mp3″ type=”audio/mpeg”> </audio>
  3. <source src=”file.mp3″ type=”audio/mpeg”>
  4. All of these.

37. Which HTML5 doctype declarations are correct?

Answers:

  1. <!doctype html>
  2. <!DOCTYPE html>
  3. <!DOCTYPE HTML5>
  4. <!DOCTYPE HTML>

38. 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:

  1. <a href=”mailto:webmaster@xcompany.com”>webmaster</a>
  2. <a href=”webmaster@xcompany.com”>webmaster</a>
  3. <a http=”mail:webmaster@xcompany.com”>webmaster</a>
  4. <mail http=”send:webmaster@xcompany.com”>webmaster</mail>

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

Answers:

  1. Polling URLs in background
  2. Syntax highlighting without blocking code editing capabilities in online IDEs
  3. Motion tracking input in realtime with a video element
  4. All of these.

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

Answers:

  1. onerror
  2. onended
  3. onloadeddata
  4. onemptied

41. 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:

  1. accept
  2. autofocus
  3. autocomplete
  4. formtarget

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

Answers:

  1. Server-Sent Events
  2. SVG
  3. Canvas
  4. Web Workers

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

Answers:

  1. Every HTML element can have an ARIA role attribute specified.
  2. Every HTML element is required have an ARIA role attribute specified.
  3. 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.
  4. There is no ARIA attribute called “role”.

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

Answers:

  1. play
  2. loop
  3. mute
  4. pause

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

Answers:

  1. True
  2. False

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

  1. 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.
  2. 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.
  3. 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.

 

47. 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:

  1. It will open the site msdn.com in the same window.
  2. It will open the site msdn.com in a new window.
  3. It will open the site msdn.com in a frame below.
  4. It will not be clickable as it is not formed correctly.

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

Answers:

  1. now
  2. 2013-05-30
  3. 2013-30-05
  4. today

49. True or false:JavaScript objects can be stored directly into localStorage.

Answers:

  1. True
  2. False

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

Answers:

  1. 65536
  2. 64
  3. There is no limit.
  4. None of these.

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

Answers:

  1. foo & bar
  2. foo &0 bar
  3. foo &0; bar
  4. foo&&& bar

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

Answers:

  1. context.clearRect ( x , y , w , h );
  2. canvas.width = canvas.width;
  3. context.clear();
  4. All of these.

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

Answers:

  1. sizes
  2. rev
  3. rel
  4. charset

54. 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:

  1. button
  2. command
  3. checkbox
  4. radio

55. 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:

  1. autocomplete
  2. autofocus
  3. placeholder
  4. formnovalidate

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

Answers:

  1. onfocus
  2. onload
  3. onblur
  4. onselect

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

Answers:

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

58. 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:

  1. 89
  2. 90
  3. Item 1
  4. Item 2

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

Answers:

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

60. Which of the following are valid HTML5 elements?

Ans:

  1. canvas
  2. summary
  3. aside
  4. video

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

Ans:

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

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

Ans: 

  1. <input type=”text” pattern=”[0-9]*” />
  2. <input type=”number” />
  3. <input type=”text” keyboard=”numeric” />
  4. <input type=”text” keyboard=”number11″ />

63. Which of the following elements have the correct attribute assignment as per HTML5?
Ans:

a. <section id=”example”>…</section id=”example”>
b. <section id=”example”>…</section id=”example2″>
c. <section id=”EXAMPLE”>…</section>
d. <section id=”Example”>…</section>
e. <section id=”example”>…</section>

64. True or false:

JavaScript objects can be stored directly into localStorage.

Ans: 

  1. True
  2. False

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

Ans: 

  1.   <br>
  2. </br>
  3. <br/>
  4. All of these

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

Ans: 

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

67.Which of the following elements have the correct attribute assignment as per HTML 5.0?

Ans:

a. <section id=”example”>…</section id=”example”>
b. <section id=”example”>…</section id=”example2″>
c. <section id=”EXAMPLE”>…</section>
d. <section id=”Example”>…</section>
e. <section id=”example”>…</section>

68.What does the icon attribute of the HTML5 command tag define?
<command icon=»?»>Click Me!</command>
Ans: 

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

69.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.
Ans: 

  1. <a name=»foo»>bar</a>;
  2. <a id=»foo»>bar</a>
  3. <div id=»foo»>bar</div>
  4. <div class=»foo»>bar</div>

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

Ans: 

  1. oninput
  2. oninvalid
  3. ondrop
  4. onrest

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

Ans: 

  1. checkbox
  2. radio
  3. command
  4. text

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

Ans: 

  1. The <keygen> tag specifies a key-pair generator field used for forms.
  2. 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.
  3. The <keygen> tag generates random passwords when the user requests for a password reset.
  4. The <keygen> tag is deprecated in HTML5.

73. Which of the following is not an attribute of theelement in HTML5?

Ans: 

  1. charset
  2. content
  3. http-equiv
  4. scheme

74.Which of the following is a proper syntax for
tag as W3C specs for HTML5 defines?

Ans: 

  1. <br/>
  2. <br/>
  3. <br>
  4. <br></br>

74.What does the icon attribute of the HTML5 command tag define?
Click Me!

Ans: 

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

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

Ans: 

  1. <input pattern=”[0-9]*” type=”text” />
  2. <input type=”number” />
  3. <input type=”text” />
  4. <input type=”text” />

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

Ans: 

  1. openDatabase.
  2. transaction.
  3. executeSql.
  4. connect.

77.Which of the following is not a valid control in HTML5?

Ans: 

  1. range.
  2. url
  3. address
  4. number

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

Ans: 

  1. range.
  2. url
  3. address
  4. number

79.Play Audio Loop using the following example?

Ans: 

  1. audio=new Audio(‘asound.ogg’);
    audio.addEventListener(‘ended’,function(){
    this.currentTime=0;
    this.play();
    },false);
    audio.play();
  2. audio=newAudio(‘someSound.ogg’);
    if(typeof audio.loop==’boolean’)
    {
    audio.loop=true;
    }
    else
    {
    audio.AddEventListener(‘loop’,function(){
    this.currentTime=1;
    this.autoplay();
    },false);
    }
    audio.play();
  3. audio=new Audio(‘asound.ogg’);
    audio.addEventListener(‘loop’,function(){
    this.currentTime=1;
    this.autoplay();

80.Which of these elements are deprecated in HTML5?

Answers:

  1. <center >
  2. <font>
  3. <iframe>
  4. <tfoot >

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

Answers:

  1. getCurrentPosition()
  2. watchPosition()
  3. getContinousPosition()
  4. watchContinuousPosition()

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

Answers:

  1. <source >
  2. <datalist>
  3. <tracklist>
  4. <toptionlist >

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

Ans: 

  1. checkType
  2. canplayType
  3. typesupport
  4. mediaPlayType

84.Drawing text, The canvas context provides following method to render the text?

Ans: 

  1. fileText(text,x,y[,maxwidth])
  2. fileText(text,x,y{,maxwidth})
  3. strokeText(text,x,y{,maxwidth})
  4. strokeText(text,x,y[,maxwidth])

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

Ans: 

  1. Server Sent Events
  2. Web Workers
  3. AJAX
  4. Push Notifications

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

Ans: 

  1. autofoucs
  2. required
  3. placehlder
  4. output

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

Ans: 

  1. preload
  2. loop
  3. stopped
  4. muted

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

Answers:

  1. <background >red</background>
  2. <body bg=”red”>>
  3. <body style=”background-color:red;”>

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

Ans: 

  1. endWorker
  2. terminate
  3. finish

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

Ans: 

  1. text
  2. password
  3. email
  4. radio

91.How can audio files be played in HTML5?

Ans: 

  1. var sound=new Audio(“file.wav”);
  2. sound.begin ( );
  3. sound.resume ( );
  4. sound.start ( );
  5. sound.play ( );

92.Which of these elements are deprecated in HTML5?

Answers:

  1. <object type=”application/pdf” data=”filename.pdf” widh=”100%” height=”100%” >
  2. <object type=”application/pdf” id=”filename.pdf” widh=”100%” height=”100%”>
  3. <input type=”application/pdf” data=”filename.pdf” widh=”100%” height=”100%”>
  4. <input type=”application/pdf” source=”filename.pdf” widh=”100%” height=”100%”>

93.Which of the following staement is correct about Server-Side image maps?

Ans: 

  1. This is enabled by the ismap attribute of the < img > tag and required access to the server and related image-map processing applications
  2. This is created with the usemap attribute of the < img > tag, along with corresponding <map> and <div>tags
  3. This is created with the image attribute of the < img> tag, along with corresponding image < map> and
    data < area>
  4. None of the above

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

Answers:

  1. <details >
  2. <font>
  3. <cite>
  4. <bdi >
  5. <title>

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

Ans: 

  1. execute
  2. execute WebSQL
  3. executeSQL
  4. executeQuery

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

Ans: 

  1. DD-MM-YYYY
  2. YYYY-MM-DD
  3. MM-DD-YYYY
  4. YYYY-DD-MM

97. Which of the following elements have the correct attribute assignment as per HTML5?
Ans:

a. <section id=»example»>…</section id=»example»>
b. <section id=»example»>…</section id=»example2″>
c. <section id=»EXAMPLE»>…</section>
d. <section id=»Example»>…</section>
e. <section id=»example»>…</section>

98. Which of the following is not an attribute of the element in HTML5?

Answers:

  1. charset
  2. content
  3. http-equiv
  4. scheme

99.Which of the following is a proper syntax for
tag as W3C specs for HTML5 defines?

Ans: 

  1. <br/>
  2. <br/>
  3. <br>
  4. <br></br>

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

Answers:

  1. Yes
  2. No

101. Which of the following elements have the correct attribute assignment as per HTML5?
Ans:

    a.<div class=»one,two,three»></div>
    b.<div class=»one;two;three»></div>
    c.<div class=»one two three»></div>
    d.<div class=»one» class=»two» class=»three»></div>

102.How to make an element draggable in HTML5?

Answers:

  1. set the draggable attribute to true as draggable=»true»
  2. set the movable attribute to true as movable=»true»
  3. set the dropable attribute to true as dropable =»true»
  4. You can not make an element draggable in HTML5

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

Answers:

  1. openDatabase
  2. transaction
  3. executeSql
  4. connect

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

Ans: 

  1. <details>
  2. <cite>
  3. <bdi>
  4. <title>

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

Answers:

  1. mark
  2. figure
  3. Canvas
  4. figcaption

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

Answers:

  1. 0
  2. 1
  3. 2
  4. 3

107.How to declare HTML5 document type?

Ans: 

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

108.Is WebSQL a part of HTML5 specification?

Answers:

  1. Yes
  2. No

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

Answers:

  1. Place all CSS/ JavaScript files within the <head> element
  2. Place all CSS/ JavaScript files at the bottom of <body> element
  3. Place CSS files within the <head > element
  4. Place JavaScript files at the bottom of <body> element

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

Answers:

  1. True
  2. False

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

Answers:

  1. abort
  2. offline
  3. onabort
  4. onbeforeonload

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

Ans: 

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

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

Answers:

  1. fillStyle()
  2. fill()
  3. color()
  4. fillColor()

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

Answers:

  1. Setting attribute dropable = «true»
  2. Calling the event.preventDefault() method for the ondragover event.
  3. Setting attribute draggable = «true»
  4. Calling the event.preventDefault() method for the ondragstart event.

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

Answers:

  1. MP4
  2. WebM
  3. color()
  4. Ogg
  5. Mov

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

Answers:

  1. track
  2. source
  3. video
  4. audio

117. Which methods are provided by geolocation?

Answers:

  1. getCurrentPosition
  2. watchPosition
  3. clearWatch
  4. All of the above

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

Answers:

  1. caption
  2. figure
  3. nav
  4. dialog

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

Answers:

  1. poster
  2. loop
  3. preload
  4. src

120. How do you declare HTML5 document type?
Ans: 

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

121. Which of the following code is valid?
Ans:

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

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

Answers:

  1. navigation
  2. footer
  3. nav
  4. meter

123. Which among the following tags define a caption for a fieldset element?
Answers:

  1. egend
  2. select
  3. input
  4. textarea

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

Answers:

  1. oninput
  2. ondata
  3. onput
  4. onhaschange

125.Which of the following tags used to specify subtitles for <video>?
Answers:

  1. <sub>
  2. <title>
  3. <subtitle>
  4. < track>

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

Answers:

  1. Paragraph
  2. Heading Correct
  3. Title
  4. All of above

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

Answers:

  1. email
  2. checkbox
  3. hidden
  4. video

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

Ans: 

  1. <movie>
  2. <media>
  3. <video>
  4. All of the above

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

Answers:

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

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

Answers:

  1. attributes
  2. parameters
  3. modifiers
  4. None of above

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

Answers:

  1. loop
  2. preload
  3. controls
  4. muted

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

Answers:

  1. Server Sent Events
  2. Web Workers
  3. AJAX
  4. Push

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

Answers:

  1. onload
  2. onloadstart
  3. onmessage
  4. ononline

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

Answers:

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

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

Answers:

  1. getCurrentPosition()
  2. watchPosition()
  3. getContinuousPosition()
  4. watchContinuousPosition()

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

Answers:

  1. range
  2. number
  3. time
  4. week

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

Answers:

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

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

Answers:

  1. url
  2. email
  3. email-address

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

Answers:

  1. <input type=»checkbox»>
  2. <check>
  3. <input type=»check»>
  4. <checkbox >

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

Answers:

  1. disabled
  2. maxlength
  3. readonly
  4. required

141. HTML tags are used to describe document ____?

Answers:

  1. Image
  2. Content
  3. Definition
  4. Groups

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

Answers:

  1. <defaultfont>
  2. <targetfont>
  3. <basefont>
  4. < body >

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

Answers:

  1. bgproperties=»stationary»
  2. bgproperties=»fixed»
  3. bgproperties=»holdstill»
  4. bgproperties=»scroll»

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

Answers:

  1. import
  2. importScripts
  3. scriptsImport
  4. importJS

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

Answers:

  1. <a href=»me@domainname.com»>Email me</a>
  2. <a href=»mailto:me@domainname.com»>Email me</a>
  3. <a href=»email:me@domainname.com»>Email me</a>
  4. <a href=»send:me@domainname.com»>Email me</a>

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

Answers:

  1. Type
  2. Never
  3. Unless border is set to zero
  4. Always

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

Answers:

  1. IMAP
  2. SMAP
  3. ISMAP
  4. imageMap

148. Please select the correct media attributes of the style element:

Answers:

  1. all
  2. printscreen
  3. not phone and (color)
  4. speech and (min-device-width: 800px)

149. Which of these statements are true?

Answers:

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

150. The default character encoding in HTML5 is?

Answers:

  1. UTF-16
  2. UTF-8
  3. UTF-32
  4. ISO-8859-1

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

Answers:

  1. <address>Last Modified: 2016/05/12 21:32:56</address>
  2. <footer>
  3. <address>
  4. Feel free to contact me at
  5. <a href=»mailto:johns@upwork.com»>John Smith</a>
  6. <p><mall>© copyright 2016 Upwork.</small></p>
  7. </address>
  8. </footer>
  9. <address>
  10. Feel free to contact me at
  11. <a href=»mailto:johns@upwork.com»>John Smith</a>
  12. </address>
  13. <p><mall>© copyright 2016 Upwork.</small></p>

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

Answers:

  1. <tfoot>
  2. <th>
  3. <col>
  4. < tcol >

153.How many tags are in a regular element?
Ans:

  • 1
  • 2
  • 3
  • 4

154. Which of the following code is valid?
Ans:

a. <div data=»{ ‘key’:’value’ }»>< /div>
b. <div data-key=»value»></div>
c. <div data_key=»value»></div>
d. <div key=»value»></div>

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

Answers:

  1. button
  2. textarea
  3. datalist
  4. select

156.Which of the following is/are valid HTML5 attributes?

Answers:

  1. webgl
  2. spellcheck
  3. manualfocus
  4. contextmenu

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

Answers:

  1. <img>
  2. <small>
  3. <p>
  4. < strong >

158.Which of these values are allowed for attribute “method” for form element?

Answers:

  1. get
  2. post
  3. patch
  4. delete

159. Which of these elements are block-level?

Answers:

  1. <h1>…<h6>
  2. <p>
  3. <img>
  4. < span >

160.Which of these values are allowed for attribute “method” for form element?

Answers:

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

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

Answers:

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

162. Which of these elements are block-level?

Answers:

  1. <list>
  2. <input type=»list»>
  3. <input type=»dropdown»>
  4. < select >

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

Answers:

  1. #BBRRGG
  2. #BBGGRR
  3. #RRGGBB
  4. #RRBBGG

164.Using Hspace will add what to your image?

Answers:

  1. Space to the left and right
  2. Space to the right and left
  3. Height to all equal
  4. Space to top and left

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

Answers:

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

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

Answers:

  1. checkType
  2. canPlayType
  3. typeSupport
  4. mediaPlayType

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

Answers:

  1. contenteditable
  2. height
  3. id
  4. name
  5. spellcheck
  6. translate
  7. value

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

Answers:

  1. textarea
  2. textml
  3. text
  4. None of the above

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

Answers:

  1. draggable
  2. context
  3. content
  4. drag

32,280 total views, 5 views today