We can easily hide and show the Html elements and its contents using Jquery Hide() function. The bellow code is used to hide the paragraph.
<html>Jquery Code for hiding the elements
<head runat="server">
<title></title>
<link href="css/ui-lightness/jquery-ui-1.8.16.custom.css" type="text/css" />
<script src="Scripts/jquery-1.6.4.min.js" type="text/javascript"></script>
<script src="Scripts/jquery-ui-1.8.16.custom.min.js" type="text/javascript"></script>">
<script type="text/javascript>
$(document).ready(function () {
$("p").click(function () {
$(this).hide();
});
$("#<%=txtDOB.ClientID%>").datepicker();
});</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<p>If u Click me i will Hide!</p>
<p>Click Me to Hide!</p>
<div>Select Your DOB<asp:TextBox ID="txtDOB" runat="server"></asp:TextBox></div>
</div>
</form>
</body>
</html>
<script type="text/javascript>
$(document).ready(function () {
$("p").click(function () {
$(this).hide();
});
});
</script>



0 comments:
Post a Comment