A jQuery "bug" for the pros- alert makes it work
<p>I have a simple function on click that toggles a div.  It checks the classes to determine if it should remove the 'hilighted' state classes.</p>

<p>This fails to remove the holdhilite class:</p>

<pre><code>function togglediv(id){
    //alert('toggle id= '+id);
    $("#"+id).toggle("fast");
    if(window.location.hash.split("#")[1]==justtheid(id)){
        var scr = document.body.scrollTop;
        window.location.href = '#';
        document.body.scrollTop = scr;          
    }       
    var trid = "tr_"+justtheid(id);
    if($("#"+trid).attr('class')=='holdhilight rowhover'){
        $("#"+trid).removeClass('holdhilight');         
    }
    else{
        $("#"+trid).addClass('holdhilight');            
    }
}
</code></pre>

<p>On the other hand, this works 100%:</p>

<pre><code>function togglediv(id){
    alert('toggle id= '+id);
    $("#"+id).toggle("fast");
    if(window.location.hash.split("#")[1]==justtheid(id)){
        var scr = document.body.scrollTop;
        window.location.href = '#';
        document.body.scrollTop = scr;          
    }       
    var trid = "tr_"+justtheid(id);
    if($("#"+trid).attr('class')=='holdhilight rowhover'){
        $("#"+trid).removeClass('holdhilight');                         
    }
    else{
        $("#"+trid).addClass('holdhilight');            
    }
}
</code></pre>

<p>Note the only difference is that alert being uncommented (i don't even want to tell you how long it took me to figure out this was the issue...  lol)</p>

<p>So, what's the deal?  why does waiting/clicking ok on the alert allow the class=='holdhilight rowhover' to match but when no alert, it does not (even though an alert in this spot says it DOES indeed match, but once the alert is in place, it works again... lol)</p>

<p>I've waiting in my browser 30 seconds before trying to close it, and that did nothing to fix it.  It's not the script taking forever to run.</p>

<p>This is all wrapped in a ready() function anyway.</p>

<p>I'm in an ie8-specific enviro (intranet) using the latest 1.9</p>
