Can't Save coordinates vars from Google Map [object HTMLInputElement]
===

    <script>
    var lat ;
	if(true) {
			navigator.geolocation.getCurrentPosition(GetLocation);
			function GetLocation(location) {
				var lat = location.coords.latitude;
			}			
	};	

	alert(lat);
     </script>	

Now I get [object HTMLInputElement] , am I doing anything wrong here ?