Hide Middle Div

Hide or show middle of 3 divs using button click.

by Steve Beckle

HTML

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<style>

.div1 {
    height:300px;
    width:20%;
    background-color: red;
    float:left;
}
.div2 {
    height:300px;
    width:20%;
    background-color: green;
    float:left
}
.div3 {
    height:300px;
    width:35%;
    background-color: pink;
    float:left
}
</style>
<meta charset="ISO-8859-1">
<title>Test</title>
</head>
<body>
<div class="div1">div1</div>
<div class="div2">div2</div>
<div class="div3">div3</div>
<br>

<div style="clear:both"></div>
<button type="button" onclick="hideDiv2()" name="hide">Hide div2</button>
<button type="button" name="show" onclick="showDiv2()" >Show div2</button>

</body>
<script>
function hideDiv2()
{
	$('.div2').hide();
}
function showDiv2()
{
	$('.div2').show();
}
</script>
</html>