Answers for "listen for double click before click"

0

listen for double click before click

element.onclick = event => {
   if (event.detail === 1) {
     // it was a single click
   } else if (event.detail === 2) {
     // it was a double click
   }
};
Posted by: Guest on June-27-2021

Browse Popular Code Answers by Language