Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/* jQuery */
element.on('click', (event) => {
event.preventDefault(); // Optional
// Do something
});
/* JavaScript */
element.addEventListener('click', (event) => {
event.preventDefault(); // Optional
// Do something
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment