I found this link of a question like the one I have, the thing is that the solution they give is for clicking any div in the html, and I need something like, when i click on the first div, the second div showing and when I press on the second div, the third div is showing. And I need to keep if in localstorage... This is my HTML code:
<div id='btn1' class="col-lg-4"">
<a id="tema_1 " href="tema.html"><img id="img_tema1" class="img-circle" src="../assets/img/primer_tema.gif" alt="Generic placeholder image" width="140" height="140"></a>
<h2>Tema 1</h2>
</div><!-- /.col-lg-4 -->
<div class="col-lg-4-2">
<a href=""><img id="img_tema2" class="img-circle2" src="../assets/img/segundo_tema.gif" alt="Generic placeholder image" width="140" height="140"></a>
<h2>Tema 2</h2>
</div><!-- /.col-lg-4-2 -->
<div class="col-lg-4-3">
<a href="tema_3.html"><img id="img_tema3" class="img-circle3" src="../assets/img/tercer_tema.gif" alt="Generic placeholder image" width="140" height="140"></a>
<h2>Tema 3</h2>
</div><!-- /.col-lg-4-3 --
And this is the example of Jquery code that i use:
var hide2 = localStorage[location] ? false : true;
var hidden2 = document.querySelector('.col-lg-4-2');
if(hide2) {
hidden2.style.display = 'none';
document.onclick = function() {
localStorage[location] = true;
hidden2.style.display = '';
document.onclick = '';
console.log('click');
}
}
But as I say... it makes that any div that I click, shows the Tema 2, and I need that the only div that can show the Tema 2 is the Tema 1 Div.
Excuse my bad English but my mother language is Spanish.
Thank you for any help.