Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="71 - Mostrar-Ocultar" />
<script src="//code.jquery.com/jquery-2.1.1.min.js"></script>m
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
<p>Mostrando y Ocultando un elemento</p>
<div id="laCapa"></div>
<button id="mostrar">Mostrar</button>
<button id="ocultar">Ocultar</button>
<button id="cambiar">Cambiar (Toggle)</button>
</body>
</html>
 
div#laCapa {
  width: 250px; height: 180px; margin: 10px;
  padding: 20px;
  background: blue; border: 2px solid black;
  cursor: pointer;
}
p, span {
  font-size: 16pt;
}
button {
  margin: 5px;
}
 
$(function() {
    $("#mostrar").click(function() {
        $("#laCapa").show("normal");
    });
    $("#ocultar").click(function() {
        $("#laCapa").hide(2000);    // ms
    });
    $("#cambiar").click(function() {
        $("#laCapa").toggle("slow");
    });
});
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
aitormedran0pro
0viewers