HTML5 interview questions and Answers - HTML5 Quiz.

In this section, I have selected advanced HTML5 interview questions and answers for Fresher and experienced cadidates. Last few months I have been working to select best HTML5 Job interview question and answer set for IT interview questions.

HTML5 interview questions and Answers:


What is HTML5?
Ans :  HTML5 is The New HTML Standard with new elements, attributes, and behaviors.

----------------------------------------------------------------------------------------------
HTML 5 Features:
Ans :
  1.  The <canvas> element for 2D drawing
  2. The <video> and <audio> elements for media playback
  3. local storage support.
  4. Added New elements, like <figure>,<small>, <header>, <nav>,<article>, <footer>, <section>,<mark>
  5. New form controls, like placeholder,calendar, date, time, email, url, search,required ,autofocus
  6. In HTML5 there is only one <!doctype> declaration: <!DOCTYPE html>
----------------------------------------------------------------------------------------------
What is HTML5 Web Storage?
Ans : In HTML5, we can store data locally within the user's browser.It is possible to store large amounts of data without affecting the website’s performance.
Web Storage is more secure and faster.
there are two types of Web Storages
1.LocalStorage:stores data locally with no limit
2.SessionStorage:stores data for one session

----------------------------------------------------------------------------------------------
How to store data on client in HTML5?
Ans : we can store data using HTML5 Web Storage.

1.LocalStorage 

<script type="text/javascript">
localStorage.name="Raj";
document.write(localStorage.name);
</script>

2.SessionStorage
<script type="text/javascript">
sessionStorage.email="test@gmail.com";
document.write(sessionStorage.email);
</script>

----------------------------------------------------------------------------------------------
How do you play a Video using HTML5?

Ans : HTML5 defines a new element to embed a video on Web Page
the <video> element.

Example:
<video width="500" height="300" controls>
  <source src="video1.mp4" type="video/mp4">
</video>

----------------------------------------------------------------------------------------------
How do you play a Audio using HTML5?

Ans : HTML5 defines a new element to embed a video on Web Page
the <audio> element.

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

----------------------------------------------------------------------------------------------
Canvas Element in HTML5?
Ans : The canvas element is used to draw graphics images on a web page

<canvas id="canvas_image" width="400" height="200"></canvas>

The canvas is a two-dimensional grid.

----------------------------------------------------------------------------------------------
HTML5 <input> Types ?
Ans : 
  • search
  • tel
  • time
  • color
  • email
  • month
  • date
  • datetime
  • datetime-local
  • number
  • range
  • url
  • week


----------------------------------------------------------------------------------------------
HTML5 New Form Attributes?
Ans :
  • pattern
  • placeholder
  • required
  • step
  • autocomplete
  • autofocus
  • height and width
  • list
  • min and max
  • multiple
  • form
  • formaction
  • formenctype
  • formmethod
  • formnovalidate
  • formtarget
----------------------------------------------------------------------------------------------
What does a <hgroup> tag do?

Ans : The <hgroup> tag is used to group heading elements.
The <hgroup> element is used to group a set of <h1> to <h6> elements.

<hgroup>
<h1>Hello</h1>
<h2>How r u?</h2>
</hgroup>

----------------------------------------------------------------------------------------------
Which video formats are used for the video element?
Ans : 
Internet Explorer 9+: MP4
Chrome 6+: MP4, WebM, Ogg
Firefox 3.6+ : WebM, Ogg
Safari 5+ : MP4,
Opera 10.6+ : WebM,Ogg

----------------------------------------------------------------------------------------------
Difference between HTML4 and HTML5 
----------------------------------------------------------------------------------------------
What is the <!DOCTYPE> ? Is it necessary to use in HTML5 ? 
Ans : The <!DOCTYPE> declaration must be the very first thing in HTML5 document, before the <html> tag

----------------------------------------------------------------------------------------------
What are the New Media Elements in HTML5?
Ans : 
  • <audio>
  • <video>
  • <source>
  • <embed>
  • <track>