Setting Input field to contain window.location.href
<p>How do I get a input field to have the value of the current webpage URL using Javascript?</p>

<p>My proposed approach: </p>

<pre><code>&lt;script&gt;
    var holder = window.location.href;
&lt;/script&gt;

&lt;input id="moo" value= holder&gt;
</code></pre>