HTML5 - Introduction
HTML5 - New Elements
HTML5 - Removed Elements
HTML5 - Browser Check
Tag Name : geo-location
HTML5 offers support for identifying uesr geo location (longitude, latitude) in the form of scripting. The user is prompted by the browser for permission before the user geo location is accessed.
HTML Example :

var messageArea=document.getElementById("userLocation");

function showGeoPosition(position)
messageArea.innerHTML="co-ordinates: " + position.coords.latitude +
" : " + position.coords.longitude;

function getUserGeoLocation()
if (navigator.geolocation)
else{messageArea.innerHTML="HTML5 Geo-Location feature is not supported by this browser.";}


<div id="userLocation"></div>
<button onclick="getUserGeoLocation()">Click To Get Your Long Lat Coordinates</button>

Output :

© 2010 All rights reserved. |