weird javascript problem with comparing
<p>i have this little piece in a function and the comparison is only working when I have the alert box before the check.</p>

<p>If I remove it, it will say it's always equal with 2 or higher... but when I have the alert box there, and it shows me they are not equal yet it works.</p>

<p>WHY? thanks</p>

<p>[edit: added the whole function, el_id is the div which is pressed and it has 2 attributes as you can see, but they dont cause the problem]</p>

<pre><code> function PostAnswer(el_id) {
    var a = $("#"+el_id).attr("answer");
    var u = $("#"+el_id).attr("player");

    // mark question as answered
    players_have_answered = players_have_answered + 1;
    if (a == game_questions[current_question][5]) {
        // CORRECT
        current_question = current_question + 1;

        // stop the clock and reset
        stop_clock();

        alert('Player '+u+' is correct!');
    } else {
        // WRONG!
        $("#lbl_u" + u + "_q").html("&lt;span class='sub'&gt;Wrong answer!&lt;/span&gt;");
    }

    alert(u + " player pressed: " + players_have_answered + " vs " + player_count);
    if (player_count == players_have_answered) {
        // stop the clock and reset
        stop_clock();
        alert('No player correct!');
    }
}
</code></pre>
