Learning Center
Learning Center
  • HTML
  • CSS
  • JAVASCRIPT
  • Bootstrap
  • React
  • jQuery
  • NodeJs
  • Sql
  • MySql
  • Python
  • OpenVPN Setup
  • Log In
Coding Choice Home About Contact ☰

  1. You are here
  2. Home
  3. html
  4. html_apis

Sidebar
  • Introduction
  • Understanding HTML
  • Basic HTML Structure
  • HTML Elements and Attributes
  • Forms and Input Fields
  • Multimedia Elements
  • Graphics and Animation
  • HTML APIs
  • HTML Cheat Sheet
  • Share via
    • Share via...
    • Twitter
    • LinkedIn
    • Facebook
    • Pinterest
    • Telegram
    • WhatsApp
    • Yammer
    • Reddit
    • Teams
  • Send via e-Mail
  • Print
  • Permalink

HTML APIs

1. Geolocation API

Get the user's location:

navigator.geolocation.getCurrentPosition(function(position) {
    console.log(position.coords.latitude, position.coords.longitude);
});

2. Web Storage API

Store data locally:

localStorage.setItem("username", "JohnDoe");
alert(localStorage.getItem("username"));