Click and Double Click in JavaScript
Published at January 5, 2019 · 1 min read
Spent a few hours on a simple task: create different handlers for ‘click’ and ‘double click’ events on the same element, onclick handler should not be executed if a double click event is raised. I hope, there is a better solution but I didn’t find it. I leave it here in case if somebody helps me with it: <html> <body> <a href="#" id="clickMe">Click Me</a> <script type="text/javascript"> /* click or double click */ var timeout = null; let link = document....