title: JavaScript - How to add onclick event dynamically passing in a specific value?
body: <p>Could you please have a quick look at the sample code</p>
  
  <p><a href="http://jsfiddle.net/vXvs2/" rel="nofollow">http://jsfiddle.net/vXvs2/</a></p>
  
  <p>I don't know if its clear, but what it's supposed to do is show what <code>i</code> was when the event was created. Instead what I think it's doing is showing the value of <code>i</code> when the event is fired.</p>
  
  <p>How would I solve my issue?</p>