mercredi 12 mai 2021

Toggle between to div's using anchor Tag Using Pure Javascript

#second{
display:none;
}
<div id="first">
<h1>First Div</h1>
<a href="#second">Go to Div2</a>
</div>

<div id="second">
<h1>Second</h1>
<a href="#first">Go to Div1</a>
</div>

Initially, Div2 will not be visible to User when user clicks on Go to Div2, he should able to see Div2 content, when user clicks on Go to Div1 he should able to able see Div1 content, At a time only one div content should be visible




Aucun commentaire:

Enregistrer un commentaire