![]() |
Change row background color when clicked
Hello,
I need your help. I can't seem to figure out as to how I would go about changing a table rows background color when it is clicked. I'd like to add functionality to my existing html page to highlight (change the row color to #DFDFDF) when a row is selected. If another row is selected then, then return the row color to its initial color and apply the color the newly selected row. Note that when the top header is clicked, id like to exempt that row from ever changing color. Here is the fiddle: http://jsfiddle.net/q42L2/ Much thanks and appreciation for all of your help Cheers, Jay |
I have the following code but some might consider it a little over-complicated:
Code:
<!DOCTYPE html> |
How about really simple. Something like this:
Code:
<!DOCTYPE html> |
Old Pendant....stunning and simply flawless!
Works like a charm. What about, if the same row that is clicked on, can that be changed from black to white? Jay |
Sure. Trivial.
Just change the highlightRow function. Rest all the same: Code:
function highlightRow( ) |
| All times are GMT +1. The time now is 06:22 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.