dollzito

section change js

Aug 24th, 2026
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. <html>
  2. <head>
  3. <style>
  4. #home {
  5. display: block;
  6. }
  7.  
  8. #one {
  9. display: none;
  10. }
  11. </style>
  12. </head>
  13.  
  14. <body>
  15. <section id="home">
  16. <button onclick="show('one')">Click</button>
  17. </section>
  18.  
  19. <section id="one">
  20. <button onclick="show('home')">Back</button>
  21. </section>
  22.  
  23. <script>
  24. function show(id) {
  25. document.getElementById('home').style.display = "none";
  26. document.getElementById('one').style.display = "none";
  27. document.getElementById(id).style.display = "block";
  28. }
  29. </script>
  30. </body>
  31. </html>
Advertisement
Add Comment
Please, Sign In to add comment