thanks alot
another beginners question:
I have a click event on every div and I want to store the IDs which have been clicked (to be exact, I only need the current ID and the previous clicked ID).
it sounds easy enough I'm however too stupid to get it work for some reason
say I want to store the previous clicked id in variable a, the current one in b:
Code:
var clicks=0;
function divClick() {
clicks++;
var a, b;
if (clicks % 2 == 0)
{
a=this.id;
checkIDs(a, b);
} else {
b=this.id;
}
}
checkIDs never gets the correct value of b (undefined) :/
is there a better approach for that?