Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <script type="text/javascript">
- function fota()
- {
- var xd=document.getElementById("selekt").value;
- xd=parseInt(xd);
- switch(xd)
- {
- case 1:
- document.getElementById("photo").src="1.png";
- break;
- case 2:
- document.getElementById("photo").src="2.jpg";
- break;
- case 3:
- document.getElementById("photo").src="3.jpg";
- break;
- }
- }
- </script>
- </head>
- <body>
- <select id="selekt">
- <option value="1">Zdjęcie numer 1</option>
- <option value="2">Zdjęcie numer 2</option>
- <option value="3">Zdjęcie numer 3</option>
- </select>
- <input type="submit" value="Wybierz" onclick="fota()">
- <br />
- <img id="photo">
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement