What are the differences between HTML5 and HTML ?
HTML
- It didn’t support audio and video without the use of flash player support.
- It uses cookies to store temporary data.
- Does not allow JavaScript to run in browser.
- Vector graphics is possible in HTML with the help of various technologies such as VML, Silver-light, Flash, etc.
- It does not allow drag and drop effects.
- Not possible to draw shapes like circle, rectangle, triangle etc.
- It works with all old browsers.
- <HTML>, <Body>, and <Head> tags are mandatory while writing a HTML code.
- Older version of HTML are less mobile-friendly.
- Doctype declaration is too long and complicated.
- Elements like nav, header were not present.
- Character encoding is long and complicated.
- It is almost impossible to get true Geolocation of user with the help of browser.
- It can not handle inaccurate syntax.
- Being an older version , it is not fast , flexible , and efficient as compared to HTML5.
- Attributes like charset, async and ping are absent in HTML.
HTML5
- It supports audio and video controls with the use of <audio> and <video> tags.
- It uses SQL databases and application cache to store offline data.
- Allows JavaScript to run in background. This is possible due to JS Web worker API in HTML5.
- Vector graphics is additionally an integral a part of HTML5 like SVG and canvas.
- It allows drag and drop effects.
- HTML5 allows to draw shapes like circle, rectangle, triangle etc.
- It supported by all new browser like Firefox, Mozilla, Chrome, Safari, etc.
- These tags can be omitted while writing HTML code.
- HTML5 language is more mobile-friendly.
- Doctype declaration is quite simple and easy.
- New element for web structure like nav, header, footer etc.
- Character encoding is simple and easy.
- One can track the Geolocation of a user easily by using JS Geolocation API.
- It is capable of handling inaccurate syntax.
- It is efficient, flexible and more fast in comparison to HTML.
- Attributes of charset, async and ping are a part of HTML 5.
There are many HTML elements which have been modified or removed from HTML5. Some of them are listed below:
- <applet> - Changed to <object>.
- <acronym> - Changed to <abbr>.
- <dir> - Changed to <ul>.
- <frameset> - Removed.
- <frame> - Removed.
- <noframes> - Removed.
- <strike> - No new tag. CSS is used for this.
- <big> - No new tag. CSS is used for this.
- <basefont> - No new tag. CSS is used for this.
- <font> - No new tag. CSS is used for this.
- <center> - No new tag. CSS is used for this.
- <tt> - No new tag. CSS is used for this.