Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Javascript how to differentiate single click event and double click event

element.onclick = event => {
   if (event.detail === 1) {
     // it was a single click
   } else if (event.detail === 2) {
     // it was a double click
   }
};
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Javascript #differentiate #single #click #event #double #click #event
ADD COMMENT
Topic
Name
4+6 =