Show / Hide a region using jQuery

jQuery Logo
This is a quick jQuery tutorial about showing / Hiding a region by clicking a link. When you click the link, the region will toggle (Show / hide).
Demo Download

HTML

<a class="link" href="#">Show Hide Message</a>
<div id="message">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>

CSS

#message {
width: 400px;
padding: 20px;
background: #ede2d6;
border: 1px solid #e1c19f;
}

jQuery

<script type="text/javascript">
$(document).ready(function(){
$("a.link").click(function(){
$("#message").slideToggle('fast');
return false;
});
})
</script>

Full Code

<!DOCTYPE html>
<html>
<head>
<title>GelCode Demo - Show Hide a Region Using jQuery</title>
<meta charset="utf-8" />
<script type="text/javascript" src="js/jquery-1.11.2.min.js"></script>
<style type="text/css">
a {
color: #495370;
text-decoration: none;
font-weight: bold;
}
#message {
width: 400px;
padding: 20px;
background: #ede2d6;
border: 1px solid #e1c19f;
}
</style>
<script type="text/javascript">
$(document).ready(function(){
$("a.link").click(function(){
$("#message").slideToggle('fast');
return false;
});
})
</script>
</head>
<body>
<a class="link" href="#">Show Hide Message</a>
<div id="message">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>
</body>
</html>

Demo Download