Code:
<!DOCTYPE html>
<html>
<head>
<title></title>
<style>
p { width: 400px; }
</style>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<button>Open/Close</button>
<p id="toggle1" style="display: none">Select :Test 1</p>
<script>
$("button").eq(0).click(function () {
$("#toggle1").slideToggle("slow");
});
</script>
<br /><br /><br /><br /><br /><br /><br /><!-- This just adds space between the two buttons -->
<button>Open/Close</button>
<p id="toggle2" style="display: none">Select :Test 1</p>
<script>
$("button").eq(1).click(function () {
$("#toggle2").slideToggle("slow");
});
</script>
</body>
</html>
Or even:
Code:
<!DOCTYPE html>
<html>
<head>
<title></title>
<style>
p { width: 400px; display: none; }
</style>
<noscript>
<style type="text/css">
p { display: block; }
</style>
</noscript>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
jQuery(function($){
$('button').click(function(){
$(this).next('p').slideToggle('slow');
});
});
</script>
</head>
<body>
<button>Open/Close</button>
<p id="toggle1">Select :Test 1</p>
<br /><br /><br /><br /><br /><br /><br /><!-- This just adds space between the two buttons -->
<button>Open/Close</button>
<p id="toggle2">Select :Test 1</p>
</body>
</html>
Bookmarks