Advertisement
Guest User

f

a guest
Sep 16th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>....Eventos: Ejemplos 0 ....</title>
  5. </head>
  6. <body>
  7. <input type="button" id="b1" value="Boton 1"/>
  8. <input type="button" id="b2" value="Boton 2"/>
  9.  
  10.  
  11. <script>
  12. b1 = document.getElementById("b1");
  13. b1.addEventListener("click", () => {
  14. //Body de la funcion ... //Funcion sin nombre lambda
  15. console.log("Click en boton 1");
  16. });//
  17.  
  18.  
  19. b2 = document.getElementById("b2");
  20. b2.addEventListener("click", clickb2);
  21.  
  22. function clickb2(){
  23. console.log("Click en boton 2");
  24. }
  25.  
  26. </script>
  27.  
  28. </body>
  29. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement