HTML5 is a markup language used to structure and present content on the World Wide Web. It is the fifth and last major HTML version of the W3C Recommendation. The current specification is known as the HTML Living Standard. It is maintained by the WHATWG, a consortium of the major browser vendors (Apple, Google, Mozilla, and Microsoft). finally, practice below the best HTML5 Interview Questions & Answers for the best preparation of the HTML 5 Interview.
Below are few major features of Html5
Q1. What is HTML5?
HTML5 is latest and current version HTML. It is the fifth major release of HTML that helps us to modify the appearance of web pages, as well as make adjustments to their appearance.
HTML5 works with browsers like Firefox, Chrome, Explorer, Safari and more, which makes the structure to display a particular web page, decides where the elements should put and where the images and the text should put. The basic structure of web page is first defined in the HTML5 language and with that, another language used to give a particular format and to get interactivity with the site.
Q2. Enlist few advantages of HTML5?
Advantages of HTML5 are as following:
Q3. What is difference between HTML and HTML5?
Some of the major differences between the HTML and HTML5 versions are:
Q4. Name the built-in object to draw on the canvas in HTML5?
The <canvas> element has no drawing ability of its own (it is only a container for graphics) - you must use a script to actually draw the graphics. The getContext("2d") object is being used to the 2D objects like draw text, lines, boxes, circles, and more on the canvas.
Q5. Enlist few tags that are no longer supported in HTML5?
The following elements are no longer supported in HTML5:
|<acronym>||Defines an acronym|
|<applet>||Defines an applet|
|<basefont>||Defines an base font for the page.|
|<big>||Defines big text|
|<center>||Defines centered text|
|<dir>||Defines a directory list|
|<font>||Defines text font, size, and color|
|<frame>||Defines a frame|
|<frameset>||Defines a set of frames|
|<isindex>||Defines a single-line input field|
|<noframes>||Defines a noframe section|
|<s>||Defines strikethrough text|
|<strike>||Defines strikethrough text|
|<tt>||Defines teletype text|
|<u>||Defines underlined text|
Q6. How to get Geolocation in HTML5?
HTML5 Geolocation API ( Application Programming Interface ) is used to get the geographical position of a user. This is related to privacy, you can’t find location unless the user approves it. navigator.geolocation.getCurrentPosition() function is used to get the user's position.
Q7. What is the sessionStorage Object in HTML5?
sessionStorage object is similar to localStorage only difference is that sessionStorage stores the data only for a session. Once the user closes the browser data is lost.
Q8. Enlist new input type attributes added in HTML5?
Following are list of new HTML5 attributes in <input>
Q9. What is MathML in Html5?
MathML is an XML (Extensible Markup Language) application for describing Mathematical notations and capturing both the structure and contents. MathML is used to enable Mathematics to be served, received and processed in www. MathML elements would be used inside HTML5 document using <math>...</math> tags.
Q10. Explain web worker in HTML5?
Web Workers are designed to do computationally expensive tasks without interrupting the user interface.
Q11. How to read and write data to local storage in HTML5?
The localStorage object stores the data with no end date. The data will not be deleted when the browser is closed, and will be available the next day, week, or year untill user will remove it.
localStorage.setItem() used to write to local storage and localStorage.getItem() can be used to get data from storage
localStorage.setItem('username','ankit'); var username=localStorage.getItem('username'); console.log(username); // ankit
Q12. What are new structuring tags introduced in HTML5?
New structuring or semantic tags introduced in HTML5 are <header> , <footer>,<article>,<section>,<aside> . Which are used to represent structure of web page.
Q13. What are Server-Sent Events in HTML5?
Server-Sent Events allow a web page to get updates from a server automatically. This was also possible before, but the web page needed to ask if any updates were available. With server-sent events, the updates come automatically from the server.
Examples: Facebook updates, Twitter updates, stock price updates, news feeds, sports results, etc.
Q14. What is difference between cookies, sessionStorage, and localStorage?
Difference between cookies, sessionStorage, and localStorage
Cookies: It is a small amount of data that the website uses to keep track of user visits and activity. Cookies are created by server code and saved on the user's computers. Cookies are read by the only server who created it.
Local storage: It is used to save data persistently on the user's computers and available until it is manually removed by the user.
Session storage: Data will be saved for the session, we close browser data will get removed.
Q15. Enlist new Form Elements introduced in HTML5?
datalist, output, keygen, progress, and meter are new Form Elements introduced in HTML5
Q16. What is Web Storage?
HTML5 provides web storage services that allow websites to store information on the browser. Web storage can store data locally and can store large data (5Mb).
Q17. What does RGB stand for?
RGB stands for Red Green Blue. It is used to create a broad array of colors by adding different values of red, blue, green colors.
Q18. Which tag is used to define deleted text?
The <del> tag is used to display the deleted text. Delete tag is markup updates and modifications in a document.