I need to exicute the function only once

I need to exicute the function only once


Right now I have  3 <a> tags

< li >< a href ="#" class ="as"> Search </ a ></ li >

< li >< a href ="#">  Lookup </ a ></ li >

< li >< a href ="#"> drop </ a ></ li >

What I want is when the user clicks on search I want to display searchdiv which is

<

div id="searchDiv" class="searchDiv" style="display:none" >

<br />

<asp:TextBox ID="txtSearch" runat="server"></asp:TextBox> <br />

<asp:Button ID="btnSearch" runat="server" Text="Search" Width="58px" />

</div>

 

so I wrote

<

script type="text/javascript">

$(

function() {

// alert("Hi");

// $('#searchDiv').hide();

$(

'a.as').click(function() {

$(

'#searchDiv').show();

});

});

</script>

which is working fine. But when I enter some text in the text box and hit search that should keep the searchdiv visible and populate another <div> with results.

 

But now when I click on search button the searchdiv is geeting invisible.

Please suggest me the best way to handle this.

Thanks,
priya