How to replace a javascript variable's value to a form field?
<p>I have</p>

<pre><code>&lt;script type="text/javascript"&gt;
    var battery = navigator.battery || navigator.mozBattery || navigator.webkitBattery;
&lt;/script&gt;
&lt;input name="battery" type="hidden" value=""&gt;
</code></pre>

<p>And I want to replace the battery's value to the input but how?</p>
