setAttributeNode is not defined comando for
function atira(x0,y0,x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,x6,y6){
var t = [], att = [], attt = [];
for(var i=0; i<7; i++){
t[i] = document.createElement("div");
att[i] = document.createAttribute("class");
att[i].value = "tiroJog";
t[i] = setAttributeNode(att[i]);
attt[i] = document.createAttribute("style");
attt[i].value = "top:"+y[i]+"px;left:"+x[i]+"px";
t[i].setAttributeNode(attt[i]);
document.body.appendChild(t[i]);
}
}
Boa noite, estou estudando javascript e implementando meus conhecimentos tentando criar jogos, ai me deparei com esse seguinte erro, vi no console e esta dando o seguinte erro setAttributeNode is not defined, ja tentei colocar as variaveis fora da funçao mas acho que isso não tem nada a ver pq só uso essas variaves nessa funçao, estou tentando a um tempao entender o motivo do erro, se alguem puder me explicar fico muito grato!?Discussão (5)
Carregando comentários...