Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Hello JS</title>
- <script>
- function lampOn(){
- document.getElementById("lampImg").src = "pic_bulbon.gif";
- }
- function lampOff(){
- document.getElementById("lampImg").src = "pic_bulboff.gif";
- }
- </script>
- </head>
- <body>
- <button onclick="lampOn()"> LAMP ON </button>
- <button onclick="lampOff()"> LAMP OFF </button>
- <img src="pic_bulboff.gif" id="lampImg">
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement