Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <DOCTYPE html>
- <html lang=pl>
- <head>
- <meta charset=utf-8>
- <title>OnClick1</title>
- <h1>zmiana obrazka po kliknięciu w niego</h1>
- </head>
- <body>
- <img id=img1 src=1.jpg alt=plik.jpg>
- <script>
- "use strict";
- var ktory=2;
- function nastepny(){
- document.getElementById("img1").src= ktory+".jpg"
- ktory++;
- if (ktory==4){
- ktory=1;
- }
- }
- window.onload=function(){
- document.getElementById("img1").onclick=nastepny;
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement