i hve been trying to add the click event to the particular div created . which was successful ,my problem is when clicked it shows me undefined.
here is the code
resulta is a global variable (array with objects)
for(s = 0;s<resulta.length;s++)
{
y = document.createElement('div')
y.setAttribute('class', 'eachssd');
var x = document.createTextNode(resulta[s].name)
y.appendChild(x);
o.appendChild(y)
y.addEventListener('click',function bnmhv(){location.href=resulta[s].datasrc},false)
}
thanks in advance