Udemy logo


HTML5 has so many new and improved features that for some web developers, it can feel like learning HTML from the top again. If you’re an up-and-coming web developer, there’s no reason not to start learning HTML5 from scratch – it is the future web standard, after all.

Beginners can find useful information and other resources in this fundamentals of HTML5 course, or this HTML5 for beginner’s course.

If you’re a step ahead and busy studying for your job interview, here are some sample HTML5 interview questions to help you prepare!

What is the origin of HTML5?

In 2004, HTML 4.01 was the standard, remaining stagnant and without updates since 2000. While the Web Hypertext Application Technology Working Group, or WHATWG, were working out a new standard, the World Wide Web Consortium, or W3C, was focusing their own efforts on XHTML 2.0.

In 2006, the two organizations decided to join forces and develop a new web standard for HTML. They are currently working on HTML5.

What are some of the key issues with previous HTML versions that HTML5 is addressing?

One main issue developers of HTML5 are aiming to reduce is the need for so many external plug-ins like Silverlight and Flash. HTML5 also offers improvements to error handling and scripting.

How would you typical HTML5 document look, and what are the primary differences between that, and an older version of HTML?

A basic HTML5 would look like this:

<!DOCTYPE html>
    <meta charset="UTF-8">
    <title>Example document</title>
    <p>Example paragraph</p>

A notable difference is the DOCTYPE declaration, which has been shortened down in HTML 5 from the lengthy declaration seen in older versions of HTML:


What are the new form element types introduced in HTML5?

What is the syntax for each of these elements?

<!--DATE TYPE to display a calendar dialogue box-->
<input type="date" name="bday">
<!--DATETIME-LOCAL TYPE to display a calendar with local time included-->
<input type="datetime-local" name="bdaytime">
<!--COLOR TYPE to display a color picker dialogue box-->
<input type="color" name="favcolor">
<!--EMAIL TYPE to display email validation text-->
<input type="email" name="email">
<!--URL TYPE to display URL validation text-->
<input type="url" name="sitename">
<!--RANGE TYPE to display a meter for range control-->
<input type="range" min="0" max="10" step="2" value="6">
<!--TELEPHONE TYPE to allow a textbox to receive telephone numbers-->
<input type="tel" name="mytel">
<!--NUMBER TYPE to create a textbox that displays number range-->
<input type="number" name="quantity" min="1" max="10">
<!--SEARCH TYPE to create a search engine box-->
<input type="search" name="googleengine">

What is the <datalist> element in HTML5? Use it in an example. Are there any limitations to it?

The <datalist> element generates an autocomplete feature for textboxes, with custom options to allow quick and easy user input.

<form action="demo_form.asp" method="get">
<input list="vgcompanies" name="browser">
<datalist id="vgcompanies">
  <option value="Sony">
  <option value="Microsoft">
  <option value="Nintendo">
  <option value="Sega">
  <option value="Valve">
<input type="submit">

The <datalist> is not supported in Safari, or Internet Explorer versions 9 and earlier.

What are some markup elements that have been added in HTML5?

Explain HTML5 web storage, and the differences between localStorage and sessionStorage.

HTML5 allows web pages to locally store data in key/value pairs within the web user’s browser, a quicker and more secure method than cookies.

Data stored in the localStorage object has no expiration date, while data stored in the sessionStorage object only lasts a single session; until the user exits their browser.

localStorage object example:

document.getElementById("result").innerHTML="Last name: "
+ localStorage.lastname;

sessionStorage example:

if (sessionStorage.clickcount)
document.getElementById("result").innerHTML="The user has clicked the button " + sessionStorage.clickcount + " time(s) during this session.";

Before an HTML5 developer uses web storage, they should check the browser support for both the sessionStorage and localStorage objects.

  // Yes! localStorage and sessionStorage support!
  // Some code.....
  // Sorry! No web storage support..

What is the application cache, and what are its benefits?

The application cache generates offline versions of a web application, making it accessible offline. It also improves the site’s performance and speed.

How do you enable the application cache?

To enable the application cache, just add the manifest attribute inside the <html> tag and link to the manifest file. If a web user visits a page with the manifest attribute included, that page will be cached.


The suggested file extension for manifest files is “.appcache,” as seen in the example above.

What is the manifest file?

The manifest file is a text file that instructs the browser what it should and should not cache when the application cache is enabled. It is made up of three parts:

Example manifest file:

# 2014-01-15 v1.0.0
/html/ /offline.html

What does the canvas element do? Give an example.

The canvas element in HTML5 is used to draw graphics through scripting. This is usually done with JavaScript.

<canvas id="myCanvas" width="200" height="100" style="border:1px solid #000000;">
Your browser does not support the HTML5 canvas tag.
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");

How would you embed an audio file using HTML5?

You can easily embed audio files with HTML5 using the convenient new <audio> tag.

<audio controls>
<source src="examplesong.mp3" type="audio/mpeg">
Your browser doesn't support audio embedding feature.

Which file formats does the <audio> tag support? Which browsers support the different formats?

MP3, WAV, and OGG files are supported by the <audio> tag.

The MP3 file format is supported by Chrome, Internet Explorer, Safari, and Firefox 21 running on Windows Vista, Windows 7, Windows 8, and Android devices. It is not supported by other versions of Firefox, or Opera.

The WAV file format is supported by Chrome, Firefox, Safari, and Opera. It is not supported by Internet Explorer.

The OGG file format is supported by Chrome, Firefox, and Opera. It is not supported by Internet Explorer or Safari.

Page Last Updated: January 2014

Top courses in HTML

The HTML & CSS Bootcamp 2024 Edition
Colt Steele
4.8 (2,338)
Highest Rated
Build Responsive Real-World Websites with HTML and CSS
Jonas Schmedtmann
4.7 (106,196)
Build Websites from Scratch with HTML & CSS
Brad Hussey, Code College
4.6 (14,555)
HTML - Introduction to HTML Web Development
Kyle Pew, Office Newb
4.7 (1,589)
Build Mega Responsive Website: HTML, CSS, JavaScript (2024)
Code And Create, George Lomidze, Lasha Nozadze
4.9 (49)
Highest Rated
Mastering HTML5: From Beginner to Advanced
Mehmood Khalil, Zaheer Irshad
4.9 (81)
HTML and CSS for Beginners - Build a Website & Launch ONLINE
Edwin Diaz, Coding Faculty Solutions
4.4 (36,131)

More HTML Courses

HTML students also learn

Empower your team. Lead the industry.

Get a subscription to a library of online courses and digital learning tools for your organization with Udemy Business.

Request a demo