Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>Zad 4</title>
  4. </head>
  5. <body>
  6. <style>
  7. body {
  8. margin:0;
  9. }
  10. p {
  11. margin:0;
  12. padding:0;
  13. }
  14. #show, #show2 {
  15. color: blue;
  16. cursor:pointer;
  17. }
  18. div {
  19. float:left;
  20. margin-left:50px;
  21. }
  22. </style>
  23. <div>
  24. <h1>Zadanie 1</h1>
  25. <p>Tu treść zadania</p>
  26. <p id="show"></p>
  27. <p id="showed">Rozwiązanie</p>
  28. </div>
  29.  
  30. <div>
  31. <h1>Zadanie 2</h1>
  32. <p>Tu treść zadania</p>
  33. <p id="show2"></p>
  34. <p id="showed2">Rozwiązanie</p>
  35. </div>
  36.  
  37.  
  38. <script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
  39. <script src="https://cdn.jsdelivr.net/npm/jquery-validation@1.17.0/dist/jquery.validate.js"></script>
  40. <script>
  41. $( document ).ready(function() {
  42. $( "#showed" ).hide();
  43. $( "#showed2" ).hide();
  44. $( "#show" ).html( "Pokaż rozwiązanie" );
  45. $( "#show2" ).html( "Pokaż rozwiązanie" );
  46. });
  47.  
  48.  
  49. $( "#show" ).click(function() {
  50. if($('#showed').is(':visible')) {
  51. $( "#showed" ).hide();
  52. $( "#show" ).html( "Pokaż rozwiązanie" )
  53. } else {
  54. $( "#showed" ).show();
  55. $( "#show" ).html( "Schowaj rozwiązanie" )
  56. }
  57. });
  58.  
  59. $( "#show2" ).click(function() {
  60. if($('#showed2').is(':visible')) {
  61. $( "#showed2" ).hide();
  62. $( "#show2" ).html( "Pokaż rozwiązanie" )
  63. } else {
  64. $( "#showed2" ).show();
  65. $( "#show2" ).html( "Schowaj rozwiązanie" )
  66. }
  67. });
  68. </script>
  69. </body>
  70. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement