JS Style Block does not execute when run from a php program
<p>I am having a strange problem.  I am using a php if to, depend on the result, send a 1 to a js function. If the 1 is sent, it should block a portion of html so it can be seen.  The 1 is being sent correctly because it displays in the alert, but when it gets to the command</p>

<pre><code>document.getElementById("countdown").style.display="block";
</code></pre>

<p>The code I am using is:</p>

<p>PHP:</p>

<pre><code>if ($Grade == "Kindergarten") 
{
    echo "&lt;script language=javascript&gt;showCountDown(1)&lt;/script&gt;";
}
</code></pre>

<p>The code in my js file is:</p>

<pre><code>function showCountDown(index)
{
    alert("Checking for Kindergarten");
    if (!index)
        var n = document.getElementById("Grade").selectedIndex;
    else
        var n = index;

    alert("Showing Index Selected: " + n);

    if (n == 1) 
    {
        alert("about to show Countdown to Kindergarten");
        document.getElementById("countdown").style.display="block";
        alert("Showing Countdown to Kindergarten");
    } 
    else 
    {
        alert("About to remove Countdown to Kindergarten");
        document.getElementById("countdown").style.display="none";
        alert("Removing Countdown to Kindergarten");
    }
}
</code></pre>

<p>Here is the strange part, at least to me, the same code works when called from the html: </p>

<pre><code>&lt;select size="1" name="Grade" id="Grade" onChange="showCountDown();"&gt;
</code></pre>

<p>I would like to, if possible, is Grade is "Kindergarten", display the div countdown.  But, I do not understand why the code is not working correctly when the correct variable is being sent.</p>

<p>Can someone help?</p>
