HTML5 APIs
Biryani delivery track karo — API se real-time location.
You open Swiggy to order biryani. The app shows your location, tracks the delivery in real-time, and shows the restaurant on a map. All of this is powered by HTML5 APIs.
HTML5 APIs are built-in tools that let your web pages do advanced things — get the user's location, draw graphics, drag elements, store data offline, and more. Best part? No external libraries needed. They're part of the browser.
The most important HTML5 APIs:
- Geolocation API — Get user's location. "Show biryani shops near me."
- Drag and Drop API — Drag elements. "Drag items to your cart."
- Canvas API — Draw graphics with JavaScript. "Draw a biryani chart."
- Web Storage API — Store data offline. "Save user preferences."
- History API — Control browser history. "Single-page app navigation."
- Geolocation: <button onclick="navigator.geolocation.getCurrentPosition(showPos)">Find My Location</button>
- Drag & Drop: <div draggable="true">Drag this item</div>
- Canvas: <canvas id="myCanvas" width="400" height="200"></canvas>
Use cases for HTML5 APIs:
- Geolocation: Restaurant locator, delivery tracking, weather
- Drag & Drop: File uploads, kanban boards, shopping carts
- Canvas: Charts, games, image editing, animations
- Web Storage: User preferences, cart data, offline content
- History: Single-page apps, tab navigation, undo actions
Build a demo page showcasing 3 HTML5 APIs: Geolocation, Drag & Drop, and Canvas.
<!-- Geolocation: Find my location button -->
<!-- Drag & Drop: Drag items into a box -->
<!-- Canvas: Draw a shape with JS -->Complete these:
Done — Key Points:
- ✅ HTML5 APIs are built into the browser — no libraries needed
- ✅ Geolocation gets user location (with permission)
- ✅ Drag & Drop lets users interact with elements
- ✅ Canvas draws graphics via JavaScript
- ✅ Web Storage saves data offline in the browser
Want to track your progress?
Log in to save your place and pick up where you left off.
Progress track karna chahte ho?
Login karo apni progress save karne ke liye aur jahan chhoda tha wahan se shuru karo.
Login