title: Put info from google maps InfoWindow into HTML textbox
body: <p>I have a map that has lots of markers pulled from a database.  Each one displays an InfoWindow with a placename and the lat and lng of the location.  I need to have the placename affiliated with a marker added to and HTML textbox on click.  I can't seem to find any tutorials on this.  Maybe someone can point me in the right direction. I am trying to learn this on my own so apologies if it is sloppily designed. Thanks for your help in advance.</p>
  
  <pre><code>function load() {
    var map = new google.maps.Map(document.getElementById("map_canvas"), {
      center: new google.maps.LatLng(41.640078, -102.669433),
      zoom: 3,
      mapTypeId: 'roadmap'
    });
    var infoWindow = new google.maps.InfoWindow;
  
    downloadUrl("mymap.php", function(data) {
      var xml = data.responseXML;
      var markers = xml.documentElement.getElementsByTagName("marker");
      for (var i = 0; i &lt; markers.length; i++) {
        var name = markers[i].getAttribute("name");
        var address = markers[i].getAttribute("address");
        var type = markers[i].getAttribute("type");
        var point = new google.maps.LatLng(
            parseFloat(markers[i].getAttribute("lat")),
            parseFloat(markers[i].getAttribute("lng")));
        var html = "&lt;b&gt;" + name + "&lt;/b&gt; &lt;br/&gt;" + point;
  
        var icon = customIcons[type] || {};
        var marker = new google.maps.Marker({
          map: map,
          position: point,
          icon: icon.icon,
          shadow: icon.shadow
        });
        bindInfoWindow(marker, map, infoWindow, html);
      }
    });
  }
  
  
  
  
  
  
  
  function bindInfoWindow(marker, map, infoWindow, html) {
    google.maps.event.addListener(marker, 'click', function() {
  
  
      infoWindow.setContent(html);
      infoWindow.open(map, marker);
    });
  }
  </code></pre>
  
  <p>It needs to go into a simple textbox like this:</p>
  
  <pre><code>&lt;input type = "text" id = "address_box" value = ""/&gt;
  </code></pre>