toggle link in jquery
<p>I am trying to toggle a link that has id showmember. </p>

<p>I did the following</p>

<pre><code>$("#table2").hide(); //this is for hiding table when page loads first time
$("#showmember").toggle(function(){
       $("#table2").show(); 
       $("#showmember").html("Hide Member Details");      
       event.preventDefault();
       }, 
       function () {
       $("#table2").hide(); 
       $("#showmember").html("Show Member Details");      
       event.preventDefault();
});
&lt;a id="showmember" href="" &gt;Show Member&lt;/a&gt;
</code></pre>

<p>However, it works sometime and sometimes it doesn't.  Actually it gives me JS error on first page load saying 'Object expected' when i click on the link it takes me to a different page. when i click browser back button and come back to original page then everything works as expected. I am using ie6</p>
