I was wondering if it is possible to pass variables outside of a function?
$('.selector').hover(function(){
var variable = $('.selector2', this).attr('id');
});
I need to get that variable to use it outside of this hover function. Is it possible?
Thanks!
EDIT ------------------------
I'm trying to click something else getting that variable outside of the hover function
$('a.btn').click(function(){
alert(variable);
});