Problem z widocznością tekstu

0

Witam.
Gdy chce przełączyć zaznaczyć inputa to znika mi tekst 1 a drugi się nie wyświetla i na stronie nie ma żadnego tekstu... Próbowałem kilku sposobów ale nic nie działa . Zawsze znika tekst1 ale tekst 2/3 nie wyświetlają się... (To ma być coś w rodzaju slidera)
Z góry dzięki za pomoc.

 <section id="testimonials">
   <div id="testAll">
    <div id="testActive">
<div id="testInfo">
  <p id="test1">I thought the hands of time would change me
    And I'd be over this by now, yeah
    It's been too long since we got crazy
    I'm lowkey spinnin' out</p>
</div>
    </div>

    <div id="test">
      <div id="testInfo">
        <p id="test2" >Then Saturday, Sunday, what?
          It's Friday again
          Then Saturday, Sunday, what?
          It's Friday again
          Then Saturday, Sunday, what?</p>
    </div>
    </div>

    <div id="test">
      <div id="testInfo">
        <p id="test3">I'm countin' down 'til Friday come
          I'm gonna, I'ma gonna do too much
          Know I'm all in my bag, that's clutch</p> 
      </div>
    </div>

    <div id="testNavigation">
     <label id="testBtn1" class="testbutton" onclick="slider1()"></label>
     <label id="testBtn2" class="testbutton"></label>
     <label id="testBtn3" class="testbutton"></label>
    </div>


   </div>
    </section>

function slider1(){
 document.getElementById("test1").style.visibility="hidden";
 document.getElementById("test2").style.visibility="visible";
 document.getElementById("test3").style.visibility="hidden";
}

jeden.png
3.png
2.png

2

JS, który wrzuciłeś, robi dokładnie to, co mu kazałeś: chowa tekst1 i tekst3, zostawiając widoczny tekst2.
Ale możliwe, że masz tam jeszcze jakieś CSS-y, które decydują o widoczności elementów.

1 użytkowników online, w tym zalogowanych: 0, gości: 1