$('#myElement').click(function() { setTimeout(function() { // Problem! In this function "this" is not our #myElement $(this).addClass('aNewClass'); }, 1000); });
now in the above code why does inside setTimeOut $(this) not pointing to $('#myElement) ??