I am trying to use jQuery to do something like
if(jQuery(\'#id\').click) {
//do-some-stuff
} else {
//run function2
}
But I\'m unsure h
You should avoid using global vars, and prefer using .data()
So, you'd do:
jQuery('#id').click(function(){
$(this).data('clicked', true);
});
Then, to check if it was clicked and perform an action:
if(jQuery('#id').data('clicked')) {
//clicked element, do-some-stuff
} else {
//run function2
}
Hope this helps. Cheers