I'm curious the different between
$('#btn').click(function(e) {
e.preventDefault();
//do sth
});
Note : $('#btn')
and this : I store my selector into a variable and re-use.
$btn = $('#btn');
$btn.click(function(e) {
e.preventDefault();
//do sth
});
Note : $btn
Now imagine, if I have do 1000 times of these in my file, which one is better to do and why ?