Click to See Complete Forum and Search --> : Row Highlight
I have a table that displays records in rows.I have a mouse over menu list that contains actions that be performed on each record.when I click on any one of these actions, I want to highlight the entire row and change the font color to red, indicating that this record is being currently looked at.How can I do this?
I have attached my code sample.
Thanks,
khalidali63
04-18-2003, 09:57 AM
Here is one of the ways you can get his done
give all the rows an id="row_1"
then from the click event pass this id index suchas onclick ="highlightRow('row_1')";
in the function highlightRow( row_id)
var row = document.getElementById(row_id);
row.style.backgroundColor="lightyellow";
row.style.color="red";
Hope this helps
please can you look at my code and tell me where I'm going wrong.It doesnt seem to be working and I get this JS error.
thanks,
khalidali63
04-18-2003, 11:01 AM
Allright check it out...
http://68.145.35.86/temp/menu_row_hilite.html
Oh BTW your code only works for IE,I guess you already know that ..right?
:D
wonderful...thanks a ton!
I guess I was missing "\" in
onClick="HighLightTR(\'#efefef\',\'#cc3300\');"
BTW, this is IE specific that I'm working on.So I dont have to bang my head to get it working on NS.
Thanks Khalid