-4
how do I create a show and hide button in Java and it leaves the content hidden already when I open the page. and I just click first to show and then to hide.
-4
how do I create a show and hide button in Java and it leaves the content hidden already when I open the page. and I just click first to show and then to hide.
0
I think that’s what you want:
Hide() hides the div when the page ends loading. toggle() is triggered by the button displaying and hiding the div
<html>
<head runat="server">
<title></title>
</head>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript">
$(document).ready(function (e) {
$("#divConteudo").hide();
$("#btnMostrarEsconder").click(function (e) {
$("#divConteudo").toggle();
});
});
</script>
<body>
<div id="divConteudo">
Conteudo
</div>
<button id="btnMostrarEsconder" type="button">Mostrar e Esconder</button>
</body>
</html>
Browser other questions tagged javascript
You are not signed in. Login or sign up in order to post.
Post the code of what you’ve already done.
– Gabriel Rodrigues
Possible duplicate http://answall.com/questions/45832/comor-alternatetexto-entre-mostrar-esconder-dentro-de-um-button-com-javascrip
– Pedro Camara Junior