Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Keydown-keyup testi</title>
- <script>
- window.onload = () => {
- document.addEventListener('keydown', (e) => {
- console.log('keydown:', e.key);
- document.dispatchEvent(new KeyboardEvent('keyup',{'key':e.key}));
- });
- document.addEventListener('keyup', (e) => {
- console.log('keyup:', e.key);
- });
- };
- </script>
- </head>
- <body>
- <h1>Keydown-keyup testi</h1>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment