title: Changing Content upon link click
body: <p>I have already tried applying some of the suggestions here but it doesn't seem to work on my task as it still shows the two div paragraph that I made. I wanted to lessen creating different pages just to output a couple of text so I decided that this could be the best course. But it is not working as how i imagined it to be. Here is the <a href="https://codepen.io/UmaruHime/pen/WXezQN" rel="nofollow noreferrer">Link</a> of what I am trying to do. And what i wanted was to have is when the chef link is clicked, the content for the origin link's paragraph and image will both change, vice versa.</p>
  
  <p>and here is the summary of the code</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() {
    $("a").click(function() {
      var id = $(this).attribute("data-id"); // Using a custom attribute.
      $("#pages div").hide(); // gather all the div tags under the element with the id pages and hide them.
      $(".div" + id).show(); // Show the div with the class of .divX where X is the number stored in the data-id of the object that was clicked.
    });
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div id="banner-wrapper"&gt;
    &lt;h1&gt; ABOUT US &lt;/h1&gt;
    &lt;h2&gt;&lt;a href="#origin" data-id="1" class="menu-text"&gt;The Origin&lt;/a&gt; &lt;span style="font-size: 56px;"&gt;||&lt;/span&gt; &lt;a href="#chef" data-id="2" class="menu-text"&gt;The Chef&lt;/a&gt;&lt;/h2&gt;
    &lt;!---Start Banner Wrapper Section--&gt;
    &lt;div id="pages"&gt;
      &lt;div class="mydivshow div1"&gt;
        &lt;section class="left-col"&gt;
          &lt;h1&gt; Sakurajima Origin &lt;/h1&gt;
          &lt;p&gt; Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nisi nibh, dictum eu laoreet at, rhoncus eget eros. Etiam elementum id nulla a accumsan. Etiam commodo fermentum sagittis. Etiam non tellus eget arcu elementum tempus. Proin pretium
            velit quis sem porttitor, eu vulputate diam ultricies. Phasellus sollicitudin gravida tortor nec ullamcorper. Sed neque lorem, tempus vel leo non, finibus fringilla velit. Quisque pellentesque diam enim, pulvinar viverra lorem hendrerit eu.
            Pellentesque porta, nisl non efficitur eleifend, lorem mauris placerat lectus, non accumsan massa ante in nisl. Fusce ornare bibendum erat. Cras placerat convallis ante, in accumsan sem cursus placerat. Pellentesque in mauris augue. Phasellus
            quis nibh felis. Aenean vulputate vestibulum nisl, a sollicitudin metus. Sed eleifend eget nulla ut consectetur. Nam venenatis scelerisque quam in viverra.&lt;/p&gt;
          &lt;p&gt;Curabitur quis tellus eget risus hendrerit vulputate. Phasellus sit amet nisi commodo, semper sapien sed, finibus purus. Duis et eleifend erat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ut urna dapibus, placerat orci a, euismod
            justo. Fusce placerat nisi sit amet pharetra mollis. Donec aliquam turpis ac ligula commodo dapibus. Suspendisse facilisis consectetur tortor id condimentum. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
            Pellentesque et sollicitudin eros, a tempus erat.&lt;/p&gt;
        &lt;/section&gt;
        &lt;section class="sidebar"&gt;
          &lt;img src="https://www.japantimes.co.jp/wp-content/uploads/2013/01/fv20120408a1b.jpg"&gt;
        &lt;/section&gt;
      &lt;/div&gt;
  
      &lt;div class="mydivhide div2"&gt;
        &lt;section class="left-col"&gt;
          &lt;h1&gt; Chef Kojirō Shinomiya &lt;/h1&gt;
          &lt;p&gt; Upon arrival in France, Kojirō immediately set off to work to make a name for himself. Setbacks soon followed him though in his first days around Paris, losing one of his luggage bags at the airport and being rejected from several restaurants.
            He later reflected on how much easier it was in Japan where every restaurant had previously wanted him to work for them. He could not even be counseled by his friends there as he had told them not to contact him or that he would not get in touch
            with them until he had succeeded. When Kojirō finally did manage to land a position after impressing the head chef, he was soon fired after being sabotaged by the sous chef who retaliated after being caught by Kojirō trying to pass off sub-standard
            meat in the restaurant. Frustrated but unwilling to give up, Kojirō sought refuge at a library, looking up different recipes so he could continue his training. As the library was preparing to close, Kojirō ran into someone unexpected.&lt;/p&gt;
          &lt;p&gt;Kojirō obtained his own restaurant, he performed well for the first few initial months, but it became apparent that he was facing adversity from the people there who belittled his ambitions. After his chefs began to disobey his judgments, Kojirō
            reached a period of depression due to the rapid decrease in work quality and positive feedback. It was at this time that he changed his entire work ethic and treatment of his employees. He fired his insubordinate chefs and became a ruthless
            head chef, intimidating his workers to obey his judgments. Because of this, Kojirō finally emerged out of his slump and the people of France began to revere him as a French Cuisine genius. After many years of hard work, Kojirō was awarded the
            Pluspol award that he had long sought after.&lt;/p&gt;
        &lt;/section&gt;
        &lt;section class="sidebar"&gt;
          &lt;img src="https://i.pinimg.com/originals/a6/41/0b/a6410b66dc1698ab56a0e57f9e933114.jpg"&gt;
        &lt;/section&gt;
      &lt;/div&gt;
      &lt;!---ENd Start Banner Wrapper Section--&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>i did not include css here since it just makes the page pretty but you can still see that on the link above.</p>
  
  <p>Do you guys know what I did wrong? and how could i fix this?</p>