1
Why I don’t get to call the function showSeatStatus(i);
?
window.onload = function() {
//Conecta os eventos de imagem de poltrona
for (var i = 0; i < tamanhoMatriz; i++) {
document.getElementById("acento"+i).onclick = function(evt) { //ELE PASSA AQUI
showSeatStatus(i); // ELE NÃO PASSA AQUI
};
}
};
If I do it without it, it turns normal, like this:
document.getElementById("acento"+0).onclick = function(evt) {
showSeatStatus(0);
};
The problem is he’s not calling the function showSeatStatus(i);
at no time.
If you give an Alert within the onclick function it alerts? , I believe the problem is that the onclick function is a Switch or it would be waiting for the action of the click, then when it loads the Switch will rotate but if the click is not made will not call the showSeatStatus
– Anderson Henrique