Html5 interview questions and answers1. What is HTML 5?
- HTML is a markup language used to design and layout web pages.
- It is a new version of the language HTML, with new elements, attributes, behaviors and hence more design options.
- HTML5 is still a work in progress. However, the major browsers support many of the new HTML5 elements and APIs.
2. Which Browsers support HTML 5 or Browser compatability of HTML 5?
- HTML5 is not yet an official standard, and no browsers have full HTML5 support.
- But all major browsers (Safari, Chrome, Firefox, Opera, Internet Explorer) continue to add new HTML5 features to their latest versions.
3. Advantages of HTML 5?
Some of the important advantages of HTML5 are listed below :
- With the help of HTML5 it is possible to embed video and audio, high quality drawings, charts and animation and many other rich content without using any plugins and third party programmas as the functionality is built into the browser.
- The video and audio tags make it easier to integrate rich media onto your site, removing the need for users to download third party software like Flash, Windows Media Player or QuickTime in order to see videos or listen to audio.
2.Cleaner Code :
HTML 5 will enable web designers to use cleaner, neater code, we can remove most div tags and replace them with semantic HTML 5 elements.
3.Offline Application cache :
While building the site, the developer can specify the files that the browser should cache. So, even if you refresh the page when you are offline, the page will still load correctly. This sort of caching has several advantages like offline browsing, files load much faster and reduced load on server etc.
4.Client-side Database or Performance improvement :
- While cookies have been used to track unique user data for years, they have serious disadvantages. The largest flaw is that all of your cookie data is added to every HTTP request header. This can end up having a measurable impact on response time. So a best practice is to reduce cookie size.
- HTML 5 provides a new SQL-based database API that can be used for storing data locally, that is client side. You get fully defined and structured database storage. This allows a developer to save structured data client-side using a real SQL database. It is not a permanent database, but enables you to store structured data, temporarily. The data can be accessed to support the web application and it can even be accessed when the client is disconnected for a short period of time. This database can be used to store e-mails or shopping cart items for an online shopping site.
5.Geolocation support :
With help of Geolocation any one can find out where you are in the world and sharing that information with people. There is different ways to figure out where you are â€” your IP address, your wireless network connection, which mobile tower your phone is talking to, or dedicated GPS hardware that calculates latitude and longitude from information sent by satellites in the sky. But The new HTML5 geolocation APIs make location, whether generated via GPS or other methods, directly available to any HTML5-compatible browser-based application. A good example is the Google Latitude for the iPhone. This is a pure Web Application not a platform-dependent iPhone application.
6.Smarter forms :
HTML 5 offers enhanced forms with improvements to text inputs, search boxes and other fields and provides better controls for validating data, focusing, interaction with other page elements on the page and various other improvements.
7.Thread-like Operation :
Web workers is a tool for spawning background threads to speed up the browse application processing. The API allows developers to make background workers that run scripts simultaneously to the main page script. This allows for faster thread-like processing with coordination via message-passing mechanisms.
8.Using files from web applications :
Using the File API, which was added to the DOM in HTML5, it's now possible for web content to ask the user to select local files, then read the contents of those files. This selection can be done by either using an HTML <input> element, or by drag and drop. This includes support for selecting multiple files using the <input> of type file HTML element's new multiple attribute. There is also FileReader.