Javascript not changing background img in a span <p>I've recently tried to use some js code that i've used for ages to change a span's background colour on certain days, i'm now trying to use the js to change the background image instead but i'm having issues. The js is finding the element but rather than change to the new image, the page is just rendering the span with no image at all. Any hints would be handy as i'm not that great with js. I do have spans identified to display as block, and the current image in the span does work when the javascript is removed.</p> <p>Javascript code: (i've cut some out so only Thursday has a command)</p> <pre><code>var d = new Date(); var weekday = new Array(7); weekday[0]="Sunday"; weekday[1]="Monday"; weekday[2]="Tuesday"; weekday[3]="Wednesday"; weekday[4]="Thursday"; weekday[5]="Friday"; weekday[6]="Saturday"; var n = weekday[d.getDay()]; var thursday = document.getElementById("th"); if (n == "Thursday") { thursday.style.color="#fff"; thursday.style.backgroundImage = "url(../images/boardMiddleOn.png)"; } </code></pre> <p>CSS:</p> <pre><code>#th { background-image:url(../images/boardMiddle.png); height: 45px; line-height: 45px; } </code></pre> <p>HTML:</p> <pre><code>&lt;span id="th"&gt;Thursday: 9am - 11pm&lt;br/&gt;&lt;/span&gt; </code></pre>