Advertisement
Fhernd

agregar-eventos-desde-js.html

May 30th, 2017
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 0.75 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="es">
  3.     <head>
  4.         <title>Agregar Eventos desde JS</title>
  5.         <meta charset="UTF-8">
  6.         <meta name="viewport" content="width=device-width, initial-scale=1">
  7.         <script>
  8.             function mostrarBienvenida()
  9.             {
  10.                 alert('Bienvenid@');
  11.             }
  12.             function saludar(){
  13.                 alert('Hola');
  14.             }
  15.  
  16.             // window.onload = mostrarBienvenida;
  17.             // window.onload = saludar;
  18.  
  19.             window.addEventListener("load", mostrarBienvenida);
  20.             window.removeEventListener("load", mostrarBienvenida);
  21.             window.addEventListener("load", saludar);
  22.         </script>
  23.     </head>
  24.     <body>
  25.    
  26.     </body>
  27. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement