Advertisement
1xptolevitico69

Keydown

Dec 2nd, 2019
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.64 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title></title>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width">
  7. <style>
  8.  
  9. img {   width:100%;height:100px;display:block;    }
  10. body {   margin:0;    }
  11.  
  12.  
  13. </style>
  14. </head>
  15. <body >
  16.  
  17. <img id='app' src='https://neanderthal-emergen.000webhostapp.com/image.png' title='car'>
  18.  
  19.  
  20. <script>
  21.  
  22. setTimeout(function(){
  23. app.style.display='none';
  24. },5000);
  25.  
  26.  
  27. document.body.addEventListener('keydown', function(event){
  28.   var x = event.keyCode;
  29.   if (x == 72) {
  30.     app.style.display='block';
  31.   }else if(x != 72){
  32. app.style.display='none';
  33. }
  34. });
  35.  
  36.  
  37.  
  38. </script>
  39. </body>
  40. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement