Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  4. <script type="text/javascript">
  5. function fota()
  6. {
  7. var xd=document.getElementById("selekt").value;
  8. xd=parseInt(xd);
  9. switch(xd)
  10. {
  11. case 1:
  12. document.getElementById("photo").src="1.png";
  13. break;
  14. case 2:
  15. document.getElementById("photo").src="2.jpg";
  16. break;
  17. case 3:
  18. document.getElementById("photo").src="3.jpg";
  19. break;
  20. }
  21. }
  22. </script>
  23. </head>
  24. <body>
  25. <select id="selekt">
  26. <option value="1">Zdjęcie numer 1</option>
  27. <option value="2">Zdjęcie numer 2</option>
  28. <option value="3">Zdjęcie numer 3</option>
  29. </select>
  30. <input type="submit" value="Wybierz" onclick="fota()">
  31. <br />
  32. <img id="photo">
  33. </body>
  34. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement