Can any one tell me why this Jquery code does not respond right?
<p>I'm trying to do simple X O game ,it seems to work just fine but when i reach the 3 "Os"
the function  call() ,it does not give me you loose in the if statement
,it does give you win wehn i reach 3 "Xs" .  </p>

<pre><code>&lt;script type="text/javascript" src="jquery.js" &gt;&lt;/script&gt;
&lt;script type="text/javascript" &gt;



    function call() {
        var x = Math.floor((Math.random() * 9) + 1);
        if ($('#td' + x).text() === "x" || $('#td' + x).text() === "o") {
            call();
        }

        else if (check() === true) {
            $('div').text("You win ");
            return false;
        }

        else if (checkLoose() === true) {
        $('p').text("You Loose ");
            return false;
        }

        else
            $('#td' + x).text("o");
        }



    function win(as, bs, cc) {
        return ($('#td'+as).text() === "x" &amp;&amp; $('#td'+bs).text() === "x" &amp;&amp; $('#td'+cc).text() === "x") ;

    }

    function check(){

        if (win(1, 2, 3) || win(1, 4, 7) || win(4, 5, 6) || win(7, 8, 9) || win(2, 5, 8) || win(3, 6, 9) || win(1, 5, 9) || win(3, 5, 7) === true) 
              return true;
 }

 function checkLoose() {

     if (lose(1, 2, 3) || lose(1, 4, 7) || lose(4, 5, 6) || lose(7, 8, 9) || lose(2, 5, 8) || lose(3, 6, 9) || lose(1, 5, 9) || lose(3, 5, 7) === true) {

         return true;
     } 
 }




    function lose(as, bs, cc) {
        return ($('#td' + as).text() === "o" &amp;&amp; $('#td' + bs).text() === "o" &amp;&amp; $('#td' + cc).text() === "o");

    }

    function dsd(sad) {

        if ($('#td' + sad).text() === "x" || $('#td' + sad).text() === "o")
            return false;

        else if (check() === true)
            return false;

        else if (checkLoose() === true) {

            return false;
        }
        else {
            $("#td" + sad).text("x");
            call();
        }       
        }

        $(document).ready(function(){
        $("td").hover(function () {
            $(this).css("background-color", "yellow");
        }, function () {
            $(this).css("background-color", "white");
        });
    });

&lt;/script&gt;

&lt;/head&gt;
&lt;body&gt;




&lt;center&gt;
&lt;h1 &gt;"        X ,O Game    "&lt;/h1&gt;&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;table&gt;
    &lt;tr&gt;
       &lt;td id="td1"  onclick="dsd(1);" &gt;&lt;/td&gt;
       &lt;td id="td2" onclick="dsd(2);"&gt;&lt;/td&gt;
       &lt;td id="td3" onclick="dsd(3);"&gt;&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
       &lt;td id="td4" onclick="dsd(4);"&gt;&lt;/td&gt;
       &lt;td id="td5" onclick="dsd(5);"&gt;&lt;/td&gt;
       &lt;td id="td6" onclick="dsd(6);"&gt;&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
       &lt;td id="td7" onclick="dsd(7);"&gt;&lt;/td&gt;
       &lt;td id="td8" onclick="dsd(8);"&gt;&lt;/td&gt;
       &lt;td id="td9" onclick="dsd(9);"&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;
&lt;/center&gt;
</code></pre>
