khaclep007

solved.html

Mar 3rd, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.36 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>Maju mundur Cantik</title>
  4. </head>
  5. <body>
  6. <button id="btn" onclick="getName(this);" name="button1">Maju</button>
  7. <button id="btn" onclick="getName(this);" name="button2">Mundur</button>
  8. <script>
  9. function getName(content){
  10. var btn = content.getAttribute('name');
  11.     alert('Your Clicked button is "' + btn + '"');
  12. }
  13. </script>
  14. </body>
  15. </html>
Advertisement
Add Comment
Please, Sign In to add comment