We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 125313d commit 92ba5b2Copy full SHA for 92ba5b2
double_click/double_click.js
@@ -0,0 +1,9 @@
1
+const btn = document.querySelector("#btn");
2
+btn.addEventListener("click", (e) => {
3
+ // console.log("clicks");
4
+ if (e.detail == 2) {
5
+ console.log("double click");
6
+ } else {
7
+ console.log("single clicked");
8
+ }
9
+});
double_click/index.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Document</title>
+</head>
10
11
+<body>
12
+ <button id="btn">button</button>
13
+ <script src="double_click.js"></script>
14
+</body>
15
16
+</html>
0 commit comments