I am putting together a Quiz where each click takes the user to a part of the Quiz. Everything is loaded on the same page so it does not skip between pages. Each slide is contained in its own div
and within them the buttons that lead to other slides.
Howitreacts:whenonthemainslideIclickonthelinkthattakestoslide1themainslideishiddenandslide1goesintoplace(usinghideandshowcss)andsoon,whenonslide1clicktogotoslide1-1slide1ishiddenandslide1-1appears.
IwouldlikeaJavaScriptfunctiontodothis.Ialreadysearchedtheforumbutcouldnotimplementittoworkdirectly.IhavelittleknowledgeinJavaScriptbutIunderstandwelllogic.
ThisisanhtmltestthatI'musing
<html><body><divclass="main">MAIN
<a href="#">slide1</a>
<a href="#">slide2</a>
</div>
<!-- second layer -->
<div class="slide1>SLIDE1
<a href="#">slide1-1</a>
<a href="#">slide1-2</a>
</div>
<div class="slide2">SLIDE2
<a href="#">slide2-1</a>
<a href="#">slide2-2</a>
</div>
<!-- third layer -->
<div class="slide1-1">SLIDE1-1</div>
<div class="slide1-2">SLIDE1-2</div>
<div class="slide2-1">SLIDE2-1</div>
<div class="slide2-2">SLIDE2-2</div>
</body>
</html>