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
Post a Comment