Forum Moderators: open

Message Too Old, No Replies

Td Background Change

         

cbovis

5:59 pm on Dec 8, 2001 (gmt 0)



i was given some code to change the background of a td when i click a link.

<a style="text-decoration: none" href="search.asp" onclick="document.getElementById('wibble').style.background = url('search_results.jpg');">

That code gives me an expected object error when i click the link.

How comes?

Craig

Will

10:08 pm on Dec 8, 2001 (gmt 0)



Sounds like you don't have an element with attribute id="wibble".

In addition, CSS doesn't use the quote marks for urls, so you would need

url(search_results.jpg)

as opposed to the current

url('search_results.jpg')

Hope this helps.