title: Jquery changing attributes using loop
body: <p>If I have the following variables:</p>
  
  <pre><code>var ordercode, ordername, order1price, orderfree;
  </code></pre>
  
  <p>How can I add the values of these variables to attr[value] using 'each'?</p>
  
  <pre><code>&lt;form&gt;
     &lt;input type="hidden" name="ordercode" value=""&gt;
     &lt;input type="hidden" name="ordername" value=""&gt;
     &lt;input type="hidden" name="order1price" value=""&gt;
     &lt;input type="hidden" name="orderfree" value=""&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Like:</p>
  
  <pre><code>$('form input').each(function {
      value = ordercode where name = ordercode
  })
  </code></pre>
  
  <p>Thanks!</p>