I need to add +1 to each card clicked but
Function result 3 as undefined why?
what is wrong with my code?
card2 and card3 function recive each variable inside each click function
inside function click2 setcard(card2); click3 setcard(card3); and so on
For some reason it do not work.
var card2 = 0;
var card3 = 0;
function setcard(card2, card3){
document.getElementById("truecount").innerHTML = card2 + card3;
}
//functions
function clickplus2() {
resultado += 2;
zen += 2;
cartas +=1;
valor +=2;
zenok +=11;
card2 +=1;
setresultado(resultado, zen, cartas, valor, zenok);
setcard(card2);
}
function clickplus3() {
resultado += 3;
zen += 2;
cartas +=1;
valor +=3;
zenok +=10;
card3 +=1;
setresultado(resultado, zen, cartas, valor, zenok);
setcard(card3);
}```