Top 10 HTML5 Interview Question

1. What's new HTML 5 DocType and Charset?

DocType tells browser about specific version of HTML. HTML 5 simplified DocType as compared to previous version of HTML. 

<!doctype html>

And HTML 5 uses UTF-8 encoding as follows:

<meta charset="UTF-8">

2. What's the real difference between HTML and HTML5?

There are remarkable difference between HTML and HTML5. HTML was a simple language for layout text as well as images on a webpage. On the other hand HTML5 can be viewed as an application development platform which does far more then HTML does. HTML5 has better support for interactive graphics, audio, video, image. HTML5 introduce a number of new elements, supports offline data storage for applications. Has proprietary plug-in technologies like Adobe Flash, Apache Pivot, Microsoft Silverlight and Sun JavaFX are no longer needed because browsers can easily process these elements without additional requirements.

3. What are some new HTML5 markup elements?

Here are some new markup elements in HTML5:

<article>,    <section>,
 <aside>,         <command>,
 <Canvas>      <audio>
 <figure>,     <details>,
 <header>,     <footer>,
 <figcaption>, <summary>,
 <progress>,   <ruby>,
 <time>,       <wpr>,
 <hgroup>,     <mark>,
 <meter>,      <nav>, 
 <rt>,         <bdi>.

4. What are the new image elements in HTML5?

<Canvas> is a new element of HTML 5 which acts like a container for graphical elements (images and graphics). It supports 2D graphics. Todays Web Browser supports WebGL. WebGL stands for Web Graphics Language, a free cross-platform API that is used for generating 3D graphics in web browsers.

<canvas id="content" width="400" height="100">


5. What are some new input attributes in HTML5?

HTML 5 introduce many new form elements including: 

datalist, datetime, 
date, month, 
week, time, 
number, range, 
email,  url
output and keygen.

6. How can we embed Audio in HTML5?

HTML 5 introduced a standard way of embedding audio files as previously we don’t have any such support on a web page. Supported audio formats are MP3, Wav ,Ogg.

<audio controls>
    <source src="audio.mp3" type="audio/mpeg">

7. How can we embed Video in HTML 5?

As audio, HTML 5 introduced a standard way of embedding video files which was not supported in previous versions. Supported video formats are MP4, WebM, Ogg.

<video width="450" height="340" controls>
  <source src="video.mp4" type="video/mp4">

8. What are the deprecated Elements in HTML5 from HTML4?

Elements that are deprecated from HTML 4 to HTML 5 are:


9. What are the new APIs provided by HTML 5 standard?

HTML 5 standard provided a number of new APIs. Few of it are as follows:

Media API
Text Track API
Command API
History API
User Interaction
Application Cache API
Data Transfer API
Constraint Validation API
and many more….

10. What are the different types of storage in HTML 5?

HTML5 enable to store data locally. Before HTML5, it was done with the help of cookies.
Important thing about this storage is that its fast as well as secure.

There are two different objects which can be used to store data.

localStorage object can store data for a long period of time even though the browser is closed. sessionStorage object can stores data for a short time user session.

author Author: Robert Calixto

comments Commenting and subscribing are very important to us because they motivate us to keep producing content of the highest caliber that appeals to your needs and interests.