HTML5 has updated features compared to HTML4 such as shorter document type declarations, built-in support for audio and video without plugins, vector graphics capabilities through SVG and canvas, geolocation APIs to identify user location, improved client-side storage options like application cache and web SQL, and allowing JavaScript to run in the background.
2. HTML 4 Vs HTML 5
DOCTYPE is much longerHTML4
DOCTYPE is much longer HTML5
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML4.01//EN”
“http://www.w3.org/TR/html4/strict.dtd”>
<!DOCTYPE html>
3. HTML 4 Vs HTML 5
Does not support audio and video without flash playerHTML4
supports audio and video controls with the use of <audio>
and <video>
HTML5
4. HTML 4 Vs HTML 5
Vector Graphics is possible with the help of technologies
such as VML, Silverlight, Flash
HTML4
Vector graphics is integral part e.g. SVG and canvas HTML5
5. HTML 4 Vs HTML 5
impossible to get true GeoLocation of userHTML4
JS GeoLocation API helps identify location of user HTML5
6. HTML 4 Vs HTML 5
Browser cache can be used as temporary storageHTML4
Application Cache, Web SQL database and Web storage is
available as client side storage.
HTML5
7. HTML 4 Vs HTML 5
Does not allow JavaScript to run in browser.HTML4
Allows JavaScript to run in background. HTML5