title: Getting the LatLng from placed marker for browser fields
body: <p>Tried the following scripts but the last section is not working. Help please.</p>
  
  <p>// script type="text/javascript"</p>
  
  <pre><code>var myOptions = {
      zoom: 7,
      center: new google.maps.LatLng(-36.624345125527526,144.96459973437504),
      mapTypeId: google.maps.MapTypeId.TERRAIN,
      streetViewControl: false,
      draggableCursor: 'crosshair',
      draggingCursor: 'pointer'
      };
  var map = new google.maps.Map(document.getElementById('map_canvas'),
      myOptions);
  google.maps.event.addListener(map, 'click', function(e) {
      placeMarker(e.latLng, map);
      });
  
  map.panTo(position);
  </code></pre>
  
  <p>// not working</p>
  
  <pre><code>google.maps.event.addListener(marker, 'dragend', function() {
      var point = marker.getPosition();
      document.getElementById("latitude").getElementsByTagName("input")[0].value = point.lat();
      document.getElementById("longitude").getElementsByTagName("input")[0].value = point.lng();
      });
  </code></pre>
  
  <p>// end of script</p>
  
  <hr>
  
  <p>Tried using the following but nothing happen after the marker is drag. Seems like the listener is not listening to the 'dragend' event of the marker. Any clue? Other option to get the latLng after dragging marker on map?</p>
  
  <p>// JS code</p>
  
  <pre><code>google.maps.event.addListener(marker, 'dragend', function(e) {
      var point = e.latLng;
      alert(marker.e.latLng);
  })
  </code></pre>
  
  <p>// end code</p>
  
  <p>The input elements part is not a choice as the scripts sit in an embedded placeholder of a web based application. So can't change that part. </p>