Javascript Switch case doesn't work even if conditions are true
<p>As my previous questions I coudn't get any answers which solved my problem, I've decided to post my entire code to determine the issue. The problem is when the button is pressed, even if one of the three images is the same (Equals all the others) for instance(three 1's appear, or three 2's appear) no message that I entered in the program is outputted instead, nothing happens.</p>

<p>Here is my original question(<a href="http://stackoverflow.com/questions/16627073/switch-case-not-working-for-images-stored-in-array">Switch case not working for Images stored in array</a>)</p>

<p>The HTML: </p>

<pre><code>&lt;html&gt;

    &lt;head&gt;
        &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
        &lt;title&gt;Untitled Document&lt;/title&gt;
    &lt;/head&gt;

    &lt;body&gt;
        &lt;form name=slots onSubmit="rollem(); return false;"&gt;
            &lt;tr&gt;
                &lt;th align=right&gt;UserTokens:&lt;/th&gt;
                &lt;td align=left&gt;
                    &lt;input type=box size=5 name=UserTokens READONLY value=25&gt;
                &lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;th align=right&gt;Your bet:&lt;/th&gt;
                &lt;td align=left&gt;
                    &lt;input type=box size=5 name=bet&gt;
                &lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;th&gt;
                    &lt;input type=submit value="Spin the slots"&gt;
                &lt;/th&gt;
                &lt;center&gt;
                    &lt;table cellspacing=5 cellpadding=2 border=0&gt;
                        &lt;tr&gt;
                            &lt;td&gt;
                                &lt;img src=number1test.gif name=slot1&gt;
                            &lt;/td&gt;
                            &lt;td&gt;
                                &lt;img src=number2test.gif name=slot2&gt;
                            &lt;/td&gt;
                            &lt;td&gt;
                                &lt;img src=number3test.gif name=slot3&gt;
                            &lt;/td&gt;
                        &lt;/tr&gt;
                    &lt;/table&gt;
                    &lt;input type=text readonly size=33 name=banner&gt;
                    &lt;/td&gt;
            &lt;/tr&gt;
        &lt;/form&gt;
    &lt;/body&gt;

&lt;/html&gt;

&lt;/html&gt;
</code></pre>

<p>And my JS (at the end of the <code>&lt;body&gt;</code>):</p>

<pre><code>slotitem = new Array('number1test', 'number2test', 'number3test'); // create array for each slot item image

tokens = 100; // starting tokens

function stopplay() { // call function

    if (document.slots.UserTokens.value &lt; tokens) // if usertokens are less than value..
    {
        alert("You lost all your tokens")

    } else // otherwise, how much the user gained
    {
        alert("You gained " + (document.slots.UserTokens.value - tokens) + " Token pieces.   ");
    }
}

function rollem() {

    if (Math.floor(document.slots.UserTokens.value) &lt; Math.floor(document.slots.bet.value)) {
        alert("Your bet is larger than your token amount")

    }

    if (document.slots.bet.value &gt; 1) {
        document.slots.banner.value = "Bet is " + document.slots.bet.value + " UserTokens pieces";
    } else {
        document.slots.banner.value = "Bet is " + document.slots.bet.value + " UserTokens piece";
    }

    counter = 0;
    spinem();

}

function spinem() { // speed of randomly generated pictures

    turns1 = 10 + Math.floor((Math.random() * 5))

    for (a = 0; a &lt; turns1; a++)

    {
        document.slots.slot1.src = "" + slotitem[a % 3] + ".gif";
    }

    turns2 = 10 + Math.floor((Math.random() * 5))

    for (b = 0; b &lt; turns2; b++)

    {
        document.slots.slot2.src = "" + slotitem[b % 3] + ".gif";
    }

    turns3 = 10 + Math.floor((Math.random() * 5))

    for (c = 0; c &lt; turns3; c++)

    {
        document.slots.slot3.src = "" + slotitem[c % 3] + ".gif";
    }

    counter++;

    if (counter &lt; 25) {
        setTimeout("spinem(counter);", 50);
    } else {
        checkmatch();
    }

}

function checkmatch() {
    // the problem is here, where the cases seem to never happen, the program just goes to the else statement, and when one case is true on the webpage, it doesnt display anything(Nor the else statement)
    if ((document.slots.slot1.src == document.slots.slot2.src &amp;&amp; document.slots.slot2.src == document.slots.slot3.src))
        switch (document.slots.slot1) {
        case "number1test":
            document.slots.banner.value = ("You got 3 in a row for 1's") // Do stuff
            break;
        case "number2test":
            document.slots.banner.value = ("You got 3 in a row for 2's")
            break;
        case "number3test":
            document.slots.banner.value = ("You got 3 in a row for 3's")
            break;
    } else {
        document.slots.UserTokens.value = document.slots.UserTokens.value - document.slots.bet.value;
        document.slots.banner.value = "No match - You lost " + document.slots.bet.value + " Token piece(s)";
    }
}
</code></pre>
