Jump to content

Change table background image On CLICK


jonnewbie12

Recommended Posts

I am designing a PHP page in dreamweaver CS5.  I have a tabe with a background image. 

 

Is there a simple code that will allow me to change the image preferably on a hover or a click. Ideally I want to get the image from the database using echo function.  I have called the table ID "td1".

 

Table code is:

 

<table width="89%" border="0" cellpadding="0" cellspacing="2" style="background:url(graphics/colourboxcream.png) no-repeat" id="td1">

 

Please, please, help  :(

Link to comment
https://forums.phpfreaks.com/topic/250323-change-table-background-image-on-click/
Share on other sites

easy to say and I am using CSS but I cant work out what the code is to change the background.  Not sure how to define the table.  Is it a get element ID or a table.id.background-image or some other code to point to the actual table?  Sorry for being a div but I know how to change the image and how to use CSS but I am having trouble trying to work out the the actual function that will change the property when clicked or hovered?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.