title: javascript toggle needs to stay
body: <p>hi guys i need some help with javascript,
  i have a toggle function for my text, waht you can see on www.jasperscheper.nl
  but i want to make the text stay when you double click on over mij and home.</p>
  
  <p>this is my 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>var bannerText1 = document.getElementById('bannertext1');
  var bannerText2 = document.getElementById('bannertext2');
  var displayedBannerText = 1;
  
  function toggleBannerText() {
    if(displayedBannerText == 1) {
      // Switch to bannertext 2
      bannerText1.className += ' hidebannertext';
      displayedBannerText = 2;
      bannertext2.className = 'welkom';
    } else {
      bannertext2.className += ' hidebannertext';
      displayedBannerText = 1;
      bannerText1.className = 'welkom';
    }
   }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;li class="knop" &gt;    
    &lt;button class="button" href="#"onclick="toggleBannerText()"&gt; &lt;h3&gt;Home&lt;/h3&gt;&lt;/button&gt; 
  &lt;/li&gt;
  &lt;li class="knop"&gt; 
    &lt;button class="button" onclick="toggleBannerText()" href="#"&gt;&lt;h3&gt;Over mij&lt;/h3&gt;&lt;/button&gt;
  &lt;/li&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>thanks in advance,</p>
  
  <p>Jasper Scheper.</p>