title: Can I have a hide/show button but the hidden script doesn't show?
body: <p>This is my code, but I don't know how to debug it. Please help me and my code. I am trying to add a hide/show button for my contents list, but I don't know what is wrong with it. It is greatly appreciated. Ummm... I don't know what to say as I have to add more information. Just comment to ask any queries.</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;How to be Asian&lt;/title&gt;
          &lt;style type=&quot;text/css&quot;&gt;
              h1, h2, h3, h4, h5, h6 {
                  font-weight: bold;
                  border: 0px;
                  margin: 2px;
              }
              h2
                  {
                  text-indent: 20px;
              }
              ul {
                  margin-top: 2%;
              }
              body {
                  margin: 2px;
                  border: 5px;
                  padding: 13px;
              }
              #Contents {
                  display: table;
                  padding: 7px;            
                  border: 1px solid #a2a9b1;
                  background-color: #f8f9fa;
                  font-size: 95%;
                  text-align: left;
                  float: right;
                  width: 15%;
              }
              #Quote {
                  text-align: center;
                  line-height: 2em;
                  padding-left: 25%;
                  padding-right: 25%;
                  padding-top: 20px;
                  padding-bottom: 20px;
                  display: block;
              }
              .Bonus {
                  display: inline;
                  font-size: 1.3em;
              }
  
              body{ 
                  padding: 1%;
                  margin: 1%
              }
  
              p h1{
                  display: inline;
                  float: left;
              }
          &lt;/style&gt;
          
      &lt;/head&gt;
      &lt;body&gt;
          &lt;script&gt;
              function myFunction() {
                  var x = document.getElementById(&quot;Contents&quot;);
                      if (x.style.display === &quot;none&quot;) {
                          x.style.display = &quot;block&quot;;
                      } else {
                          x.style.display = &quot;none&quot;;
                      }
                  }
          &lt;/script&gt;
          &lt;div id=&quot;Contents&quot;&gt;
              &lt;h1 id=&quot;Contents&quot;&gt;Contents&lt;/h1&gt;&lt;button onclick=&quot;myFunction()&quot;&gt;[show]&lt;/button&gt;
              
              &lt;ol&gt;
                  &lt;li&gt;&lt;a href=&quot;#Chapter_1&quot;&gt;Chapter 1: Early Childhood&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href=&quot;#Chapter_2&quot;&gt;Chapter 2: Primary School Education&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href=&quot;#Chapter_3&quot;&gt;Chapter 3: High School Education&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href=&quot;#Chapter_4&quot;&gt;Chapter 4: College/University Education&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href=&quot;#Chapter_5&quot;&gt;Chapter 5: Employment&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href=&quot;#Chapter_6&quot;&gt;Chapter 6: Relationships&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href=&quot;#Chapter_7&quot;&gt;Chapter 7: Family Gatherings&lt;/a&gt;&lt;/li&gt;
                  &lt;ol&gt;
                      &lt;li&gt;&lt;a href=&quot;#Chapter_7.1&quot;&gt;Chapter 7.1: Public Holidays&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href=&quot;#Chapter_7.2&quot;&gt;Chapter 7.2: Death and mourning&lt;/a&gt;&lt;/li&gt;
                  &lt;/ol&gt;
                  &lt;li&gt;&lt;a href=&quot;#Chapter_8&quot;&gt;Chapter 8: Retirement&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href=&quot;#Chapter_9&quot;&gt;Chapter 9: Death&lt;/a&gt;&lt;/li&gt;
              &lt;/ol&gt;
          &lt;/div&gt;
          &lt;div&gt;
              &lt;h1 id=&quot;Chapter_1&quot;&gt;Chapter 1: Early Childhood&lt;/h1&gt;
              &lt;p&gt;When Asian kids go through pre-schooling years and primary school, children are always put under pressure and always neglected so that they work harder and feel like they are worth something after some time and not actually useless.&lt;br&gt;&lt;span id=&quot;Quote&quot;&gt;&quot;We just never praise our children, always compare them to people who are better, so they grow up never feeling good enough and then have to constantly outdo everybody else to feel like they aren’t worthless.&quot; &lt;br&gt; Quoted from Stven He's father&lt;/span&gt;&lt;/p&gt;
          &lt;/div&gt;
          &lt;div&gt;
              &lt;h1 id=&quot;Chapter_2&quot;&gt;Chapter 2: Primary School Education&lt;/h1&gt;
              &lt;p&gt;Asian kids are always compared to their peers by their parents. This is because Asian parents want the best of the child. This also means that children are used too much for the simplest of their demands. &lt;br&gt; &lt;br&gt; During this period of learning, PTSD is most used so that children are trained to cope &quot;in the future&quot;. &quot;In the future&quot; meaning whenever you go back to your parents house when you are and adult. But this training will deal emotional damage, social anxiety and negliegence. This part of life is when most of the tactics are used so that the child can get used to them. Once they know how to leave the situation, create more problems for the child so that they get more experience. &lt;/p&gt;
              &lt;p&gt;This period of their life is when you can take advantage of them. For example, when you are shopping, tell your child that you are going to get something common in the household, like rice. Then, go to the aisle and watch them go to the cashier person and panic as you are assumed to get rice. Once they start getting constipated, go back with a 5kg bag of rice and start telling your child off for constipating in public. &lt;/p&gt;
              &lt;div style=&quot;text-align: center;&quot;&gt;
                  &lt;h4 class=&quot;Bonus&quot;&gt;BONUS! &lt;/h4&gt;&lt;p class=&quot;Bonus&quot;&gt;If you can humiliate your child in front of anyone, especially your child's friends, it will intergrate information for life. &lt;/p&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div&gt;
              &lt;h1 id=&quot;Chapter_3&quot;&gt;Chapter 3: High School Education&lt;/h1&gt;
              &lt;p&gt;This period of life is when you get to choose his choices. &lt;/p&gt;
          &lt;/div&gt;
          &lt;div&gt;
              &lt;h1 id=&quot;Chapter_4&quot;&gt;Chapter 4: College/University Education&lt;/h1&gt;
          &lt;/div&gt;
          &lt;div&gt;
              &lt;h1 id=&quot;Chapter_5&quot;&gt;Chapter 5: Employment&lt;/h1&gt;
          &lt;/div&gt;
          &lt;div&gt;
              &lt;h1 id=&quot;Chapter_6&quot;&gt;Chapter 6: Relationships&lt;/h1&gt;
          &lt;/div&gt;
          &lt;div&gt;
              &lt;h1 id=&quot;Chapter_7&quot;&gt;Chapter 7: Family Gatherings&lt;/h1&gt;
              &lt;h2 id=&quot;Chapter_7.1&quot;&gt;Chapter 7.1: Public Holidays&lt;/h2&gt;
              &lt;h2 id=&quot;Chapter_7.2&quot;&gt;Chapter 7.2: Death and mourning&lt;/h2&gt;
          &lt;/div&gt;
          &lt;div&gt;
              &lt;h1 id=&quot;Chapter_8&quot;&gt;Chapter 8: Retirement&lt;/h1&gt;
          &lt;/div&gt;
          &lt;div&gt;
              &lt;h1 id=&quot;Chapter_9&quot;&gt;Chapter 9: Death&lt;/h1&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>