This is my code:
for(var i = 0; i < 13; i++)
north.innerHTML += "<div onclick='remove()' style='display:inline-block; position:relative;'>" +
"<img width='50px' style='cursor:pointer' height='100px'src=path"+player1[i]+".png'/>" +
"</div>";
The problem I'm encountering is in the onclick
attribute of the div's I'm inserting.
When using onclick='remove()'
the script works, but when i change the function to be executed with some other function declared by me it doesn't work.
I initially thought there may be a problem with the function i declared, but it doesn't work even with simple function as:
function example()
{
prompt('example');
}
Any suggestions? This is a link to the script : https://drive.google.com/file/d/0B44rvU_T40BTVGN2V1RmVWdSS28/view?usp=sharing