Last Updated: March 23, 2020
Author: Full Stack Tutoorials
HTML5 is a markup language used for structuring and presenting content of a web page.
DOCTYPE is short form of Document Type Declaration.
it tells the web browser about the version of markup language in which a web page is written.
You may also like - HTML and CSS Interview Questions
HTML5 is more powerfull and easier than HTML4, HTML5 has lots of new TAG like header, footer, nav, audio, video, main etc.
DOCTYPE declaration in Html is too longer
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|DOCTYPE declaration in HTML5 is very simple "<!DOCTYPE html>|
Character Encoding in HTML is also longer
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|Character Encoding (charset) declaration is also very simple <meta charset="UTF-8">|
|Audio & Video||Audio and Video are not part of HTML4||Audio and Videos are integral part of HTML5 e.g. <audio> and <video> tags.|
|Vector Graphics||Vector Graphics is possible with the help of technologies such as VML, Silverlight, Flash etc||Vector graphics is an integral part of HTML5 e.g. SVG and canvas|
|GeoLocation||It is almost impossible to get true GeoLocation of user browsing any website especially if it comes to mobile devices.||JS GeoLocation API in HTML5 helps identify location of user browsing any website (provided user allows it)|
|Shape||Not possible to draw shapes like circle, rectangle, triangle.||Using HTML5 you can draw shapes like circle, rectangle, triangle.|
|Browser Support||Works with all old browsers||Supported by all new browsers|
You may also like - Bootstrap Interview Questions
You can store data locally using HTML5 Storage. Exciting thing about this storage is that its fast as well as secure.
|It persists data until we close the window or tab in which it was stored.||It persist data even if the window or tab is closed (but can be explicitly removed or expires).|
|Values stored in sessionStorage are not shared. These will be visible only to respective window or tab.||Values stored in localStorage are shared for all windows and tabs from same origin.|
|Maximum size is 5MB (can vary on different browsers).||Minimum size is 5MB (can vary on different browsers).|
You may also like - PHP Developer Interview Questions
SVG stands for Scalable Vector Graphics.
HTML5 introduced the two graphical elements Canvas and SVG for creating rich graphics on the web, but they are fundamentally different
|Vector based (composed of Shapes)||Raster based (composed of Pixel)|
|Multiple graphical elements, which become the part of the DOM||Single HTML element similar to
|Modified through script and CSS||Modified through script only|
|Give better performance with smaller number of objects or larger surface, or both||Give better performance with smaller surface or larger number of objects, or both|
|Better scalability — can be printed with high quality at any resolution||Poor scalability — not suitable for printing on higher resolution|
The terminate() method of the Worker interface immediately terminates the Worker var myWorker = new Worker('worker.js'); myWorker.terminate();
Server-Sent Events allow a web page to get updates from a server.
You may also like - React.js Interview Questions
HTML5 introduced a new concept Application Cache - means that a web application is cached, and accessible without an internet connection.
There are three advantages of Application Cache:
The HTML5's application cache feature is supported in all major modern browsers like Firefox, Chrome, Opera, Safari and Internet Explorer 10+.
A Manifest file is a simple text file that tells the browser what to cache and what not to cache.
To enable the application cache for an application, you must include the manifest attribute in the <html> element in your application's pages
There are three sections of a Manifest file:
You may also like - MySQL Interview Questions