html5 interview questions and answers

What is HTML5?

HTML5 is a latest version of HTML. HTML5 is a new version of the language HTML, with new elements, attributes, and behaviors.

What is DOCTYPE in HTML5?

DOCTYPE also called Document Type Declaration which used to declare document. DOCTYPE used by browsers to render document.

DOCTYPE is a instruction to the web browser about what version of HTML the page is written in.

DOCTYPE must be declare before the <html> tag.

See example

<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
content
</body>
</html>

What is localStorage in HTML5?

localStorage object is also store information into clients browser. The main difference is that localStorage has no expiration time.  localStorage data persist till user not clear data or reset browser. Means user clear data from browser.

Learn more about localStorage

What is sessionStorage in HTML5?
The sessionStorage object is use to store data into client browser. sessionStorage is only available for the duration of the browser session and is deleted when the window is closed. sessionStorage depend upon session of a page. Page session maintain till user not open new tab or window or not reloads page.

If user open a page in a new tab or window and reloads page, it will create new session.That means sessionStorage can't be shared between tabs and window. sessionStorage is only available for the duration of the browser session and is deleted when the window is closed.

Learn more about localStorage

How to enable cache in HTML5?
What is Web Worker in HTML5?
What is a draggable attribute in HTML5?
What is a placeholder attribute in HTML5?
How you get current location of User in HTML 5 ?
What is the difference between Canvas and SVG graphics?
How to draw rectangle using Canvas and SVG using HTML 5 ?
What are selectors in CSS?
How can you apply CSS style using ID value?
What is the use of column layout in CSS?
Can you explain CSS box model?
Can you explain some text effects in CSS 3?
What are web workers and why do we need them ?
How can we add and remove data from local storage?
What is the lifetime of local storage?
What is the difference between local storage and cookies?
What is difference between session storage and local storage?
What is WebSQL?
Is WebSQL a part of HTML 5 specification?
So how can we use WebSQL ?
So how do we implement application cache in HTML 5 ?
What is fallback in Application cache?



Thanks for your comment