title: Data Attributes into Fields Value
body: <p>I am struggling with adding <strong>data-</strong> attributes into inputs of a form by clicking on a link. If I click on another link then previous values should be replaced with new ones which are related to this link.</p>
  
  <p>This is my code of the links:</p>
  
  <pre><code>&lt;div id="links"&gt;
  &lt;h3&gt;Links&lt;/h3&gt;
  &lt;a href="#1" data-url="http://apple.com" data-name="My url"&gt;Link 1&lt;/a&gt;
  &lt;a href="#2" data-url="http://bbc.co.uk" data-name="My second url"&gt;Link 2&lt;/a&gt;
  &lt;a href="#3" data-url="http://google.com" data-name="My third url"&gt;Link 3&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And this is a code of my form:</p>
  
  <pre><code>&lt;div id="form"&gt;
  &lt;h3&gt;Form&lt;/h3&gt;
  &lt;input type="text" size="25" value=""&gt;
  &lt;input type="hidden" name="" value=""&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>So I have got only one form to serve all links (maybe over 100 in total).</p>
  
  <p>Please see my JSFIDDLE here: <a href="http://jsfiddle.net/jtzrjrs2/1/" rel="nofollow">http://jsfiddle.net/jtzrjrs2/1/</a></p>
  
  <p>I really appreciate your help.</p>