<head>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<style>
p {
padding: 10px;
border: 1px solid black;
width: 50%;
}
</style>
</head>
<body>
<button id="fadeToggleBtn">Toggle Paragraph</button>
<p>This is the first paragraph.</p>
<p>This is the second paragraph.</p>
<script>
$(document).ready(function() {
$("#fadeToggleBtn").click(function() {
$("p").fadeToggle();
});
});
</script>
</body>
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.