I have a div that when I clicked, wants to perform an action.
This div contains some text.
If the user selects the text (for example, they try to copy / paste, and not click on it), I want to cancel the onclick event so that the action does not happen if they just tried to select, and not actually click.
Is there a way to do this using jQuery or plain old javascript?
source share