Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>
- </title>
- </head>
- <body>
- <input type ="button" id="clickme" value="Click Me"/>
- </body>
- <script language ="javascript">
- // lay element co id = "clickme" luu vao bien button
- var button = document.getElementById('clickme');
- // khi click vao element chua trong button thi thuc hien
- // trong ham function thong bao hello word
- button.addEventListener('click',function(){
- alert('Hello world');
- });
- </script>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement