Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Feb 9th, 2010 | Syntax: None | Size: 0.63 KB | Hits: 28 | Expires: Never
Copy text to clipboard
  1. <script type="Text/JavaScript">
  2. var x;
  3. function showDiv(x) {
  4. if (x==1) {
  5.         spoiler.style.display = "block";
  6.         nospoiler.style.display = "none";
  7. }else{
  8.         spoiler.style.display = "none";
  9.         nospoiler.style.display = "block";
  10. }
  11. }
  12. </script>
  13.  
  14. <div id="spoiler" style="display:none;">
  15. This is the spoiler text.<br />
  16. <button type="button" onclick="showDiv(0)";><font color="#000000" size="1"><b>Hide Spoiler</b></font></button>
  17.  
  18. </div>
  19. <div id="nospoiler" style="display:block;">
  20. Click button to see the spoiler.<br />
  21. <button type="button" onclick="showDiv(1)";><font color="#000000" size="1"><b>Show Spoiler</b></font></button>