Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1

Thread: javascript Tr

  1. #1
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    javascript Tr

    Hi I am very new to javascritp and just playing around with a few things. I am looking for a way to change the background style of a table row element

    I have a table that is dynamically created using PHP at the end of each row inside a <td> in the table one per row there is an image. When this image is clicked I would like the background colour of the entire row that image is on to change to #CCC

    also if another image is clicked in the table I want to revert the background colour of the previous row back to blank and select the new row.

    A sort of highlight per row that you select. only being able to select one row at a time.

    thanks in advance for any help.

    Edit:
    if it is not too much more code though I have a feeling it is some <td>'s in the row I want selected might be empty if this is the case I wouldn't like the background of that td to change, or change the <tr> background and change empty <td>'s to the table backgrounds colour.

    But as I said this isn't really that important as I imagine it is more than a couple of lines of code extra
    Last edited by settoloki; 06-21-2009 at 07:21 PM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •