<!DOCTYPE html>
<title>My Example</title>
<style>
p {
background: gold;
padding: 20px;
}
</style>
<!-- Load jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<!-- Use jQuery -->
<script>
// Wait for DOM to load and be ready
$(document).ready(function(){
// Click event handler
$( "p" ).click(function() {
// Fade out the element
$( this ).fadeTo( "slow", 0.5 );
});
</script>
<p id="fadeMe">Click me to fade me.</p>