How can I determine the last clicked id ?! Because if I use:
if(clicks > 1){
var lc = event.target.id;
}
It will return the current click on the button. I have something like this:
$('
clicks++;
if(clicks > 1){
var lc = event.target.id; // Last Clicked event
}
console.log(lc);
And I have two buttons. Now, if I click on the first button of the console, the log will show undefinded, but if I click on the second button, it will show its identifier. I want to prevent this.
source
share