jQuery fadeOut() with speed

Description

jQuery fadeOut() with speed

View in separate window

<!DOCTYPE html>
<html>
<head>
<script 
 src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js">
</script>//  www  .ja  v a  2 s  .  co m
<script>
$(document).ready(function(){
  $(".btn1").click(function(){
    $("p").fadeOut(1000);
  });
  $(".btn2").click(function(){
    $("p").fadeIn(1000);
  });
});
</script>
</head>
<body>

<button class="btn1">Fade out</button>
<button class="btn2">Fade in</button>

<p>This is a paragraph.</p>

</body>
</html>



PreviousNext

Related