I'm using JQuery to throw out a nice error message which fades and vanishes on click. Problem is, this error message is used for a variety of things, but it only works once. e.g. user has to be logged in to do something, but I show the button to do it anyway in order to entice users to signup. When they click the button if they're not logged in, an error message shows. There are more than 1 button doing the same thing, but if one button has been clicked, the error message doesn't show again... JQUERY: <script type="text/javascript"> $(".alerts").click(function () { $(this).fadeOut('slow'); }); $(".fadeInbox").click(function () { $(this).hide().fadeIn(2000); }); $(".fadeTobox").click(function () { $(this).fadeTo('fast',0.2); }); $("#reset").click(function(){ location.reload(); }); $(document).ready(function() { $('a[href=#top]').click(function(){ $('html, body').animate({scrollTop:0}, 'slow'); return false; }); }); </script> Code (markup): BUTTONS: <div class="greybuttons"> <?php if ($notloggedin == "true"){ echo "<a href=\"#\" class=\"fav\" title=\"Add Magazine to your favorites\" id=\"attach_box\"></a><a href=\"#\" class=\"wish\" title=\"Mark this issue to read later\" id=\"attach_box\"></a><a href=\"#\" class=\"remove\" title=\"Flag this publication\" id=\"attach_box\"></a>"; } else { echo "<a href=\"addfav.php?id=$id&uid=$user_id\" class=\"fav\" title=\"Add Magazine to your favorites\" ></a><a href=\"readlater.php?id=123&uid=321\" class=\"wish\" title=\"Mark this issue to read later\"></a><a href=\"readlater.php?id=123&uid=321\" class=\"remove\" title=\"Flag this publication\"></a>"; } ?> </div> <div class="read_more"> <?php if ($notloggedin == "true"){ echo "<a href=\"/uploader/file/$pdf\" target=\"_blank\" title=\"Read Issue $issue_number of $main_title\" class=\"readnow\" id=\"attach_box\"></a>"; } else { echo "<a href=\"/uploader/file/$pdf\" title=\"Read Issue $issue_number of $main_title\" class=\"readnow\" target=\"_blank\"></a>"; } ?> Code (markup): Is there any way to completely reset the function once it's been clicked?
There's nothing in your sample code that includes an error message, or any HTML that references that jQuery, so I'm not sure I can help...