Is this possible? And if so, how?¨ Is it possible to setAttribute onclick=myFunction() with a variable as parameter?
var variableCross = localStorage.getItem('cross'+localStorage.getItem('number'));
del.setAttribute("onClick","myFunction(variableCross);");
myFunction(variableCross); sends variable like a string? doesn't it?
thx
Assuming this bit of code does what you want
var variableCross = localStorage.getItem('cross'+localStorage.getItem('number'));
Then this should work for you
del.addEventListener("click", function(event) {
myFunction(variableCross);
event.preventDefault();
});