I need to do 2 things on click. The first happens straight away, then the second thing happens after the first thing has finished.
I'm trying to chain functions as callbacks, but this doesn't seem to be working.
$(document).ready(function(){
$('button').click(function(){
// first thing
console.log('click');
}, function(){
// second thing
console.log('callback');
});
});
That code only logs the second message. I need it to do the first, then the second. What's the correct way of doing this?