Without using callback function, and console message is displayed before the hide effect is completed - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:hide

Description

Without using callback function, and console message is displayed before the hide effect is completed

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $("button").click(function(){
        $("p").hide(1000);
        console.log("The paragraph is now hidden");
    });// ww  w . jav a 2  s . c om
});
</script>
</head>
<body>

<button>Hide</button>

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

</body>
</html>

Related Tutorials