Debian Codegraph @

good-listener/demo/destroy.html

raw
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4 <meta charset="UTF-8">
5 <title>Destroy</title>
6 </head>
7 <body>
8 <!-- 1. Write some markup -->
9 <button class="target">Click me</button>
10 <button class="target">Click me</button>
11 <button class="target">Click me</button>
12
13 <!-- 2. Include library -->
14 <script src="../dist/good-listener.js"></script>
15
16 <!-- 3. Remove listener by calling the destroy function -->
17 <script>
18 var listener = listen('.target', 'click', function(e) {
19 console.info(e);
20 });
21
22 listener.destroy();
23 </script>
24 </body>
25 </html>