title: get the latitude and longitude using javascript
body: <p>I have a <code>textbox</code> in my page which gets a <code>location</code> name and <code>button</code> with text <code>getLat&amp;Long</code>. Now on <code>clicking</code> my button I have to show an <code>alert</code> of <code>latitude</code> and <code>longitude</code> of the location in the <code>textbox</code>. Any suggestion?
  <br>please dont give me suggestion as googleapis b'coz its some stage limitations after this limit want to pay for this. 
  this is my try with <code>googleapis</code>:-</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"&gt;&lt;/script&gt;
   &lt;script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  function myIP(){
  $("#btn").click(function(){
              var geocoder =  new google.maps.Geocoder();
      geocoder.geocode( { 'address': '#city'}, function(results, status) {
            if (status == google.maps.GeocoderStatus.OK) {
              alert("location : " + results[0].geometry.location.lat() + " " +results[0].geometry.location.lng()); 
            } else {
              alert("Something got wrong " + status);
            }
          });
  });
  }
   &lt;/script&gt;
  &lt;/head&gt;
  &lt;body onload="myIP()"&gt;
  &lt;input type="text" id= "city"&gt;
  &lt;input id="btn" type="button" value="get Lat&amp;Long" /&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>thanks.</p>