Click event - get the target where the mousedown started instead of the mouseup
You could use mousedown together with a mouseup function, and have them both saving their targets to a global variable, then compare them in an if statement.
let downTarget, upTarget;
$(document).mousedown(function(e) {
downTarget = e.target;
});
$(document).mouseup(function(e) {
upTarget = e.target;
});
if(upTarget === downTarget){
*do stuff*
};