title: Click button that fills input & submits
body: <p>First off, let me say I'm very much new to Javascript, and relatively clueless when it comes to the backend of the application I recently had developed. I'm working on the front-end design/minor functionality. So, if you could please keep that in mind with your answers, that'd be much appreciated!</p>
  
  <p>I have an input field where a user can enter an address, and click submit to bring up a property results page.</p>
  
  <pre><code>&lt;input type='text' class='main-search-address' id="main-search-address" placeholder="Enter Street Address"&gt;in Seattle, WA
  &lt;input value="Search" type="submit" class="submit" id='main-search'&gt;
  </code></pre>
  
  <p>On the results page, there is a section where nearby addresses are displayed, via AJAX/js like so:</p>
  
  <pre><code>&lt;span id="nearby_address"&gt;this gets replaced with an address&lt;/span&gt;
  </code></pre>
  
  <p>For example</p>
  
  <pre><code>&lt;span&gt;1103 YAKIMA AVE S&lt;/span&gt;
  </code></pre>
  
  <p>I'm looking for some javascript that will allow me to click the address in the span tag, have it paste into the input above, and automatically 'submit'-- all with one click.</p>
  
  <p>Any help?</p>
  
  <p>Thanks!</p>