In javascript/jquery, I have a button that have a click event defined like:
$("#target").click(function() {
var mouse_click = ________________;
// do stuff
if (mouse_click) {
// do stuff
}
// do stuff
});
and I also have code to do
$('#target').click();
How can I get the variable mouse_click
to be true
, if the user manually clicked the tag using the mouse, and the variable to be false
when I click the tag using the .click()
function?
Thanks