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