HTML5 – Interview Questions 

Top HTML5 Interview Questions that you must need to know.

1) Once an application is offline, it remains cached until the following happens?

a) The manifiest file is modified.

b) The application cache gets automatically cleared by the browser.

c) The application cache is programmatically  updated.

d) The user clears their browser’s data storage for the site.


2) What is the internal format of input type=”date” in HTML5?






3) Which of the following method can be used to estimates the page load times?

a) Using _gap.push([“_trackPageLoadTime”]) with Google Analytics.

b) Page load times can not be estimated.

c) Using the Navigation Timing JavaScript API.

d) Using built-in JavaScript methods.


4) 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>
 var canvas = document.getElemantById("e");
 // insert code here
 context.fillStyle = "blue";
 context.font = "bold 16px Arial";

a) var context = canvas.getContext();

b) var context = canvas.getContext(“2D”);

c) var context = canvas.getElementById(“context”);

d) var context = canvas.getElementById(“2D”);


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

a) <object> <param name=”allowFullScreen” value=”true” />

b) <video allowFullScreen=”true”>

c) <video height=”100%” weight=”100%”>

d) None of these.


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

a) Drag and drop files from the desktop.

b) Full file system access.

c) Use of the HTML5 File API.

d) Use of files as HTML5 input types.


7) When does the ondragleave mouse event get fired in HTML5?

a) It gets fired when an element has been dragged to a valid drop target.

b) It gets fired when an element leaves a valid drop target.

c) It gets fired at the end of a drag operation.

d) It gets fired while an element is being dragged.


8) Given following HTML and CSS, what will be the height of parent element having “wrap” class?


.wrap{ box-sizing: border-box; }

.col{ height:100px; margin:20px;}


<div class="wrap">

<div class="col"> </div>

<div class="col"> </div>


a) 260px

b) 140px

c) 220px

d) 280px


9) Which CSS2 selector, selects all Button elements that have a space seperated list of values for attr where one of those values is equal to the given value?

a) button[attr~=value]

b) button[attr^=value]

c) button[attr|=value]

d) button[attr=value]


10) Which of the following CSS rule would make all h3 tags that are immediately preceded by a section tag italic?

a) section~h3 {font-style: italic;}

b) section>h3 {font-style: italic;}

c) section+h3 {font-style: italic;}

d) section h3 {font-style: italic;}


11) What is the use of datalist in HTML5?

a) Enables a tag contain additional data(meta data).

b) Provides autocomplete feature in a textbox.

c) Provides SEO friendly markup for page context.

d) Alternate markup for building accessible lists.


12)  Generally, quirks mode could turned on when there is:

a) NO or Incorrect DOCTYPE declaration.

b) Spaces or illegal chars before DOCTYPE

c) Invalid HTML – with respect to the chosen DOCTYPE

d) All of the above


13) Which CSS rule would make the fourth list item underlined, if the list had a fourth item?

a) ul li: nth(4th) { text-decoration:underline; }

b) ul li: nth-child(4) { text-decoration: underline; }

c) ul li: 4th-child { text-decoration: underline; }

d) ul li: nth-of-type(4) { text-decoration: underline;}


14) Which property specifies whether the mask should scroll or stay fixed the page is scrolled?

a) mask-clip

b) mask-repeat

c) mask-attachment

d) mask-image


15) The property defines whether or not an ellipsis should be displayed when content overflows a region?

a) text-overflow

b) overflow-style

c) content-overflow

d) overflow


16) Which rule is used to define the properties that will be animated in an animation rule?

a) @transition

b) @key

c) @keyframes

d) @animation


17) What is the attribute used in <video> element, that is set to the URL of an image that the browser will use in place of the video before it is loaded and playing?

a) placeholder

b) poster

c) banner

d) preload


After read all of the above questions you need to explore the Javascript Interview Questions