.ASPX Code.
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<script src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function() {
$("#show").click(function() {
$(".mydiv").show(1000);
});
$("#hide").click(function() {
$(".mydiv").hide(1000);
});
});
</script>
<title>Show-Hide div using JQuery</title>
<style type="text/css">
.mydiv
{
margin:10px;padding:12px;
border:2px solid #666;
width:100px;
height:100px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div class="mydiv">
This is test div
</div>
<input id="show" type="button" value="Show" />
<input id="hide" type="button" value="Hide" />
</form>
</body>
</html>
DEMO:-
Show Hide test div
No comments:
Post a Comment