jQuery Uncaught TypeError?
<p>I am currently working on a website. What I want it to do is when you load the page a countdown starts, and after 15 seconds a button appears.</p>

<p>Currently it works perfectly on my test server, and on jsFiddle. However when I move it to my web server it doesn't work. I took a look in Google Chrome's Console, and I get the following error.</p>

<pre><code>downloadButton.parentNode.replaceChild(newElement, downloadButton);
Uncaught TypeError: Cannot read property 'parentNode' of null
</code></pre>

<p>Here is the full code (See also jsFiddle <a href="http://jsfiddle.net/6zchq/" rel="nofollow">http://jsfiddle.net/6zchq/</a>)</p>

<pre><code>var downloadButton = document.getElementById('download');
var counter = 15;
var newElement = document.createElement('p');
newElement.innerHTML = 'Getting your file, please wait 15 seconds.';
var id;

downloadButton.parentNode.replaceChild(newElement, downloadButton);

id = setInterval(function() {
    counter--;
    if(counter &lt; 0) {
        newElement.parentNode.replaceChild(downloadButton, newElement);
        clearInterval(id);
    } else {
        newElement.innerHTML = "Getting your file, please wait " + counter.toString() + " seconds.";
    }
}, 1000);
</code></pre>

<p>I'm sure this is a simple problem, I just cannot figure out why it's not working.</p>

<p>Any help is appreciated!</p>

<p>Thanks.</p>
