1
Good afternoon ,I need help regarding jquery , below an example :
<ul>
<li><a href="#1">Conteudo1</a></li>
<li><a href="#2">Conteudo2</a></li>
<li><a href="#3">Conteudo3</a></li>
</ul>
<div class="teste" id="1">
<p>Teste 1</p>
</div>
<div class="teste" id="2">
<p>Teste 2</p>
</div>
<div class="teste" id="3">
<p>Teste 3</p>
</div>
$(document).ready(function(){
$('.teste').hide();
});
How to make appear only the div that is referenced in the menu when I click ?
These href will all be #1?
– Sergio
use jquery onClick event
– Marcus Daniel
Sorry , more do not know how to do , someone could help me , Sergio each hfref and referring to an id , just correct
– Lenilson Teixeira
@Gabrielrodrigues in the question you mentioned the user asks the answer in pure javascript. Here would be using jQuery.
– Joao Paulo
@Joaopaulo no, the answer voted as correct by Diego Vieira has the resolution for both javascript and jQuery.
– Gabriel Rodrigues
@Gabrielrodrigues also this issue has its own context. It is not enough to know how to show and hide a div.
– Joao Paulo