jQuery: if click again, hide
<p>Right now you click on a link, it send ajax call and on success it prepends the output in . Not i would like to, if you click on the link while its open then it should close/hide the output.</p>

<pre><code>function MoreFriendOptions(friend){
$.ajax({ 
       type: "POST",
       url: "misc/GetMoreFriend.php",
    data: {
    mode: 'ajax',
    friend : friend
    },
       success: function(msg){
      $('#MoreFriendInfo'+friend).prepend(msg);

        }
     });
}

echo "&lt;div id='MoreFriendInfo".$showInfo['bID']."'&gt;&lt;/div&gt;";
   &lt;div style="float: right;"&gt;
  &lt;a href="javascript:void(0);" onclick="MoreFriendOptions(&lt;?=$showInfo["bID"];?&gt;)"&gt;mer&lt;/a&gt;
   &lt;/div&gt;
</code></pre>
