HTML5 Is The Fifth and Latest Version of HyperText Markup Language
HTML5 Is The Fifth and Latest Version of HyperText Markup Language
modern multimedia-rich web applications. It improves upon previous versions with **better
semantics, enhanced APIs, and mobile-friendly features**, eliminating the need for plugins like
Flash.
---
1. **Semantic Elements**
- Tags like `<header>`, `<footer>`, `<nav>`, `<article>`, and `<section>` improve document
structure and SEO.
- Example:
```html
<header>Website Logo</header>
<nav>Menu Links</nav>
```
2. **Multimedia Support**
- Native `<audio>` and `<video>` elements eliminate Flash dependency.
- Example:
```html
<video controls>
<source src="movie.mp4" type="video/mp4">
</video>
```
4. **Form Enhancements**
- New input types: `email`, `date`, `url`, `range`, `color`.
- Attributes like `required`, `placeholder`, and `pattern` for validation.
- Example:
```html
<input type="email" required placeholder="Enter email">
```
6. **Geolocation API**
- Accesses user’s location for maps or location-based services.
- Example:
```javascript
navigator.geolocation.getCurrentPosition(showPosition);
```
8. **Web Workers**
- Runs JavaScript in background threads to prevent UI freezing.
- Example:
```javascript
let worker = new Worker("script.js");
```