jquery - callback button - show, hide element with element id - sample

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
$(document).ready(
function(){
    $("#bh").click(function(){
        $("p").hide("slow", function(){
            alert("The paragraph is now hidden");
        });
    });
}
);

$(document).ready(
function(){
    $("#bs").click(function(){
        $("p").show("quick", function(){
         //   alert("The paragraph is now show");
        });
    });
}
);
</script>
</head>
<body>

<button id="bh">Hide</button>
<button id="bs">show</button>

<p>This is a paragraph with little content.</p>

</body>
</html>

Yorumlar