I'm using only javascript, not jQuery or no other javascript frameworks.
I have created one anchor tag like:
var _a = document.createElement('a');
now I want to add onclick for this tag. I have tried following:
_a.onclick = function(){ mycode(id); }
The function applies on that but the anchor tags are create in loop... so mycode(id)
is always taking the last value of the loop.
Can any one help me out in this ?