title: Creating button click event (Google Maps)
body: <p>I am working with Google Maps embedded on my webpage. What I want is to create a button click event, so then after a user has entered an address into a textbox called txtBoxMaps, they can click a button which will display the new location. I tried using: google.maps.event.addDomListener(window, 'click', Initialize); but it doesnt seem to do anything.</p>
  
  <p>Here is my code below:</p>
  
  
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  function Initialize() {
  
  var mapOptions = {
              center: new google.maps.LatLng(-33.01, 27.9),
              zoom: 13,
              mapTypeId: google.maps.MapTypeId.ROADMAP
          };
  
          var map = new google.maps.Map(document.getElementById('GMap1'), mapOptions);
  
          var input = document.getElementById('txtBoxMaps');
  
          });
  
      }
  
      google.maps.event.addDomListener(window, 'load', Initialize);
  
  
  
  &lt;/script&gt;
  
  
  
  &lt;input type="text" id="txtBoxMaps"/&gt;
  
          &lt;div id="GMap1" style="height: 240px; width:570px" &gt;&lt;/div&gt;
  </code></pre>