Advertisement
Guest User

Untitled

a guest
Oct 17th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <script>
  6. function zmien_kwadrat()
  7. {
  8. var k=document.getElementById("kwadrat");
  9. if (k.style.backgroundColor=="red")
  10. {
  11. with (k.style)
  12. {
  13. backgroundColor="yellow";
  14. width="200px";
  15. height="200px";
  16. }
  17. }
  18. else
  19. {
  20. with (k.style)
  21. {
  22. backgroundColor="red";
  23. width="400px";
  24. height="400px";
  25. }
  26. }
  27. }
  28. </script>
  29. </head>
  30. <body>
  31. <div id="kwadrat"
  32. style="background-color:red; width:400px; height:400px;" onclick="zmien_kwadrat();"
  33. </div>
  34. </body>
  35. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement