javascript - jQuery get lasted clicked on element...? -


hey, hope can this..

how can previous id of clicked div element using jquery?

is possible?

e.g. have 2 div's named div1 , div2, click on div1 on div2, how can id of div1?

many thanks

store in variable.

var lastclicked = null;  $("div").click(function() {     if (lastclicked) {         // use lastclicked here     }      // current click stuff      lastclicked = this; }); 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -