How can I make% change with a push of a button? in case I have 3 buttons, the first one will cause the first div
to be displayed, the second to show the second div and the third to make the third div
appear.
Something similar to what this does, but can only appear one at a time, if the div
1, which is the one that appears by default, appears, 2 and 3 can not be displayed. >
$( "#Clique1" ).click(function() {
$("#opcao1").css("display","block");
});
$( "#Clique2" ).click(function() {
$("#opcao2").css("display","block");
});
$( "#Clique3" ).click(function() {
$("#opcao3").css("display","block");
});
#opcao2{
display:none;
}
#opcao3{
display:none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><divid="opcao1">
Eu apareço
</div>
<div id="opcao2">
Eu irei aparecer se ele sumir
</div>
<div id="opcao3">
Eu também irei aparecer se ele sumir
</div>
<button id="Clique">troca para a opcao1</button>
<button id="Clique2">troca para a opcao2</button>
<button id="Clique3">troca para a opcao3</button>