title: how to set a value to an input field onclick with jquery
body: <p>I am trying to set the value of an existing input filed to another input filed with onclick.</p>
  
  <pre><code>&lt;p&gt;Name: &lt;input id="john" type="text" value="" name="user"&gt;&lt;/p&gt;
  &lt;input type="hidden" value="John" /&gt;
  &lt;span&gt;Set value&lt;/span&gt;
  </code></pre>
  
  <p>When click on span, the value of the hidden <code>input</code> (in this case <code>John</code>)  should be placed as value ont the input field above it. So onclick:</p>
  
  <pre><code> &lt;p&gt;Name: &lt;input id="john" type="text" value="" name="user"&gt;&lt;/p&gt;
  </code></pre>
  
  <p>becomes</p>
  
  <pre><code> &lt;p&gt;Name: &lt;input id="john" type="text" value="John" name="user"&gt;&lt;/p&gt;
  </code></pre>
  
  <p>How can i do that with jquery?</p>
  
  <p>I already have this code but i do not succeed in it:</p>
  
  <pre><code>$("span").click(function(){
     $("input:#john").val();
  });
  </code></pre>