Pass a javascript variable to html. jQuery
<p>I have a variable in Javascript: </p>

<pre><code>var test ="whatever"
</code></pre>

<p>I just want to pass this variable inside a hidden input:</p>

<pre><code>&lt;input type="hidden" class="myinput" value=""&gt;
</code></pre>

<p>I tried:</p>

<pre><code>$('.myinput').attr('test');
</code></pre>

<p>But it does not seem to work.</p>

<p>Thank you for your help.</p>
