HTML5 New Features Every Beginner Must Know
HTML5 New Features Every Beginner Must Know
nn
If you have worked through this entire series starting from What is HTML? A Complete Beginner Guide with Examples, you have actually been writing HTML5 the whole time — the <!DOCTYPE html> declaration at the top of every page is the HTML5 doctype. But HTML5 introduced a great deal more than just the document structure. This final tutorial in the series covers the features that make modern web development genuinely different from how websites were built ten or fifteen years ago.
nn
New Semantic Elements
nn
We covered the main semantic elements in HTML Div, Span and Semantic Elements Explained, but HTML5 added several more worth knowing. The <details> and <summary> elements create collapsible sections with no JavaScript required at all.
n
<details>n <summary>What is HTML5?</summary>n <p>HTML5 is the fifth major revision of the HTML standard, finalised in 2014.n It introduced semantic elements, new input types, native audio and video support,n and browser-based storage APIs.</p>n</details>
nn
This renders as a collapsible FAQ-style element. Clicking the summary text expands the content below. Pure HTML — no CSS tricks, no JavaScript. The <time> element marks up dates in a machine-readable way, and <mark> highlights text like a marker pen.
nn
New HTML5 Input Types
nn
HTML5 massively expanded the <input> element we covered in HTML Forms and Input Elements — Complete Guide with Examples with new type values. These are especially useful on mobile devices where the browser shows the appropriate keyboard automatically based on the input type.
n
<input type="email"> <!-- validates email format, email keyboard on mobile -->n<input type="url"> <!-- validates URL format -->n<input type="number"> <!-- numeric keyboard on mobile -->n<input type="tel"> <!-- phone dial pad on mobile -->n<input type="date"> <!-- native date picker -->n<input type="time"> <!-- native time picker -->n<input type="range"> <!-- slider control -->n<input type="color"> <!-- native colour picker -->n<input type="search"> <!-- search-styled input with clear button -->
nn
These are genuinely useful in practice. A date input on mobile shows the native date picker instead of making users type a date manually. A number input shows the numeric keypad. All of this is built in, no plugins required.
nn
Native Audio and Video
nn
Before HTML5, embedding video or audio required Flash plugins — which are now completely gone from the web. HTML5 added native <video> and <audio> elements that work directly in every modern browser.
n
<video width="640" height="360" controls poster="thumbnail.jpg">n <source src="tutorial-intro.mp4" type="video/mp4">n <source src="tutorial-intro.webm" type="video/webm">n Your browser does not support the video element.n</video>nn<audio controls>n <source src="podcast-episode.mp3" type="audio/mpeg">n</audio>
nn
The controls attribute adds the built-in play/pause/volume interface. Multiple <source> elements let you provide the media in different formats — the browser picks the first one it supports. The poster attribute on <video> shows a thumbnail image before the video plays.
nn
The Canvas Element
nn
The <canvas> element creates a drawable area on the page that JavaScript can paint on. On its own it is invisible — you use JavaScript to draw shapes, charts, images, and animations inside it. It is the foundation for browser-based games and data visualisation tools.
n
<canvas id="myCanvas" width="400" height="200"></canvas>nn<script>n const canvas = document.getElementById('myCanvas');n const ctx = canvas.getContext('2d');n ctx.fillStyle = '#e74c3c';n ctx.fillRect(20, 20, 150, 80);n ctx.fillStyle = '#2c3e50';n ctx.font = '18px Arial';n ctx.fillText('Hello Canvas!', 30, 70);n</script>
nn
This draws a red rectangle with text inside it. From here you can draw anything — lines, circles, images, animated games. The canvas is essentially a blank painting surface driven entirely by JavaScript.
nn
HTML5 Local Storage
nn
HTML5 introduced localStorage — a way to store data in the user’s browser without cookies and without involving a server. Data stored here persists even after the browser is closed and reopened.
n
<script>n // Save datan localStorage.setItem('username', 'Raj');n localStorage.setItem('theme', 'dark');nn // Read datan const name = localStorage.getItem('username');n console.log(name); // Output: Rajnn // Remove one itemn localStorage.removeItem('theme');nn // Clear everythingn localStorage.clear();n</script>
nn
This is used for remembering user preferences, saving form drafts, storing settings locally. sessionStorage works identically but is cleared when the browser tab is closed — useful for temporary session data.
nn
Geolocation API
nn
HTML5 added browser-based geolocation through JavaScript. With the user’s explicit permission, you can retrieve their approximate location from the browser itself.
n
<button onclick="getLocation()">Find My Location</button>n<p id="location-output"></p>nn<script>n function getLocation() {n if (navigator.geolocation) {n navigator.geolocation.getCurrentPosition(function(position) {n const lat = position.coords.latitude;n const lon = position.coords.longitude;n document.getElementById('location-output').textContent =n 'Latitude: ' + lat + ', Longitude: ' + lon;n });n } else {n document.getElementById('location-output').textContent =n 'Geolocation not supported by this browser.';n }n }n</script>
nn
The browser asks the user for permission first — they must actively accept. This powers location-based features in web apps without requiring a native mobile app to be installed.
nn
You Now Know HTML — What Comes Next?
nn
Completing this series means you genuinely understand how HTML works — from the very first <!DOCTYPE html> we wrote in What is HTML? A Complete Beginner Guide with Examples, through tags and attributes in HTML Tags, Elements and Attributes Explained with Examples, text formatting, links, images, lists, tables, forms, page structure, and now HTML5 features. That is the complete foundation.
nn
The natural next step from here is CSS — which takes everything you have built in HTML and controls exactly how it looks. Layout, colours, fonts, spacing, animations, responsive design — all CSS. After that, JavaScript brings your pages to life with interactivity and dynamic behaviour. But none of that works without the HTML foundation you now have.
nn
Go back through any tutorial in this series that felt unclear and type the code examples yourself. Build something small — a personal profile page, a simple contact form, a product listing table. Hands-on practice is what turns reading into real skill. You have everything you need to start.