<button onclick="foo();">generate event object</button> <script> function foo() { console.log(event); } </script>