Check out example codes for "input location html". It will help you in understanding the concepts better.

Code Example 1

<form>
  <input type="button">
  <input type="checkbox">
  <input type="color">
  <input type="date">
  <input type="datetime-local">
  <input type="email">
  <input type="file">
  <input type="hidden">
  <input type="image">
  <input type="month">
  <input type="number">
  <input type="password">
  <input type="radio">
  <input type="range">
  <input type="reset">
  <input type="search">
  <input type="submit">
  <input type="tel">
  <input type="text">
  <input type="time">
  <input type="url">
  <input type="week">
</form>

Code Example 2

<script>
var x = document.getElementById("demo");
function getLocation() {
  if (navigator.geolocation) {

      navigator.geolocation.getCurrentPosition(showPosition);
  } else {

      x.innerHTML = "Geolocation is not supported by this browser.";

    }
}


 function showPosition(position) {
  x.innerHTML = "Latitude: " + position.coords.latitude + 
  "<br>Longitude: " + position.coords.longitude; 

 }
</script>

Learn ReactJs, React Native from akashmittal.com