How to define the onClick property of the Buttons created inside this loop?.JQuery doesn't seem to work at all for that class.
for(started somewhrere...
var button = document.createElement('button')
var div = document.createElement('div')
var img = document.createElement('img')
img.src = "../img/download.png"
var p = document.createElement('p')
p.appendChild(document.createTextNode("Descargar"))
div.appendChild(img);
div.appendChild(p);
button.appendChild(div);
button.onClick = "DOSOMETHINGFFS()"
button.className = "download"
for end somewhere...}
function DOSOMETHINGFFS(){
alert("no")
}
BTW JQuery isn't really helping at all
$(".download").click(function() {
alert("ok")
});