JS: Selecting div's href's and applying the text of href to an input
<p>I have a <code>div</code> named #div1 which gets a random values of <code>href</code>.
For example:</p>

<pre><code>&lt;div&gt;
&lt;a href="#"&gt; Apple &lt;/a&gt;
&lt;a href="#"&gt; Orange &lt;/a&gt;
&lt;a href="#"&gt; Lemon &lt;/a&gt;
&lt;a href="#"&gt; Banana &lt;/a&gt;
&lt;/div&gt;
</code></pre>

<p>How is it possible, when ever I click any of those to be applied to <code>input</code> #input1 with <code>Javascript</code>?</p>

<p>The form is: <code>&lt;input type="text" name="q" id="input1" &gt;</code></p>

<p>Thanks alot.</p>
