1 | <html>
|
2 | <head>
|
3 | <title>Events</title>
|
4 | </head>
|
5 | <body>
|
6 | <button>Click me</button>
|
7 | <button onclick="unbind()">Unbind</button>
|
8 | <script src="../build/build.js"></script>
|
9 | <script>
|
10 | var Events = require('events');
|
11 | var button = document.querySelector('button');
|
12 |
|
13 | var events = Events(button, {
|
14 | remove: function(){
|
15 | alert('removed')
|
16 | }
|
17 | });
|
18 |
|
19 | events.bind('click', 'remove');
|
20 |
|
21 | function unbind() {
|
22 | events.unbind();
|
23 | }
|
24 | </script>
|
25 | </body>
|
26 | </html>
|