How i can determine the last clicked id ?!
Because if i use :
if(clicks > 1){
var lc = event.target.id; // Last Clicked event
}
It will return the current button clicked id
I have something like this :
$('#menu).click(function(event) {
clicks++;
if(clicks > 1){
var lc = event.target.id; // Last Clicked event
}
console.log(lc);
And i have 2 buttons
Now if i click on first button console log will show undefinded but if i click on second button it will show his id.I want to prevent that
You can use
.data()for this,http://jsfiddle.net/aDUdq/