Hide and show toggle – jQuery

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $("#my_toggle button").click(function(){
        $("#my_toggle div").slideToggle();
    });
});
</script>
</head>
<body>
<div id="my_toggle">
  <button>Toggle slideUp() and slideDown()</button>
  <div>This is a paragraph.</div>
</div>
</body>
</html>


Example:

This is a paragraph.