This seems like a very basic thing to do, but I don't understand why is not working: jsfiddle
function click(){
$('#button').click(function(){
return true;
});
}
if(click()){alert('clicked')}
I want to return true if the button is clicked, is it possible to use the function directly into the if statement and then do something depending on the returned value ?
In the real scenario I need a function that can check for what button is clicked and depending on that I want to call other functions
if(click() == 'returned value'){differentFunction()}