Hide all element of the form using JQuery

Virendradugar
Posted by Virendradugar under jQuery category on | Views : 5391
Below code will hide all elements of the form using JQuery. You can download the Jquery from http://docs.jquery.com/Downloading_jQuery.

<script type="text/javascript" src="Script/jquery-1.3.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(form1.elements).hide()
});
</script>


Kindly note form1 is the id of the form. See below.

<form id="form1" runat="server">
<div>
<a href="http://jquery.com/">jQuery</a>
</div>
<asp:TextBox ID="txtName" runat="server"></asp:TextBox>
<p>
Hello
<table>
<tr>
<td>
Virendra
</td>
<td>
Dugar
</td>
</tr>
</table>
</p>
<div id="dvWidth">
<h1>
Virendra Dugar</h1>
</div>
<br />
<a id="hypDotnetFunda" href="http://www.dotnetfunda.com/default.aspx">DotnetFunda</a>
<br/>
<asp:Label ID="lblMessage" runat="server" Text="Virendra Dugar at Dotnetfunda"></asp:Label>
</form>


This code will hide every single element of the form.

Thanks.

Comments or Responses

Login to post response