# Radio Button that Highlight Entire row?

**URL:** <https://forum.kirupa.com/t/radio-button-that-highlight-entire-row/31259>\
**Category:** Uncategorized\
**Created:** [September 20, 2003, 2:11am UTC](https://forum.kirupa.com/t/radio-button-that-highlight-entire-row/31259 "2003-09-20T02:11:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![j03y](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@j03y](https://forum.kirupa.com/u/j03y)\
**Post date:** [September 20, 2003, 2:11am UTC](https://forum.kirupa.com/t/radio-button-that-highlight-entire-row/31259/1 "2003-09-20T02:11:31Z")

</div>

hey guys, can anyone of you help me… pls. :\*( i have a radio button then that grows, then i have a list of names each name has a button. the names are from the database. btw, im using php…

i use javascript to highlight the \<tr\> when the radio button is selected… i works fine… but it only work if you define the ID on the javascript, i have alot of data on MySQL, so if i display it all, its impossible for me to add all the id on the javascript and its not the right thing to do it… i can give ID to all \<tr\> tags but to define it to javascript is to impossible…

Ok, now here’s my question, how can i do it in a very easiest way and also its crossbrowser (sorry for my english 🙂 )

[my example code:]

\<script\>  
function clearAll(){  
document.getElementById(“colorback1”).className = “bgwhitesmoke”  
document.getElementById(“colorback2”).className = “bgwhitesmoke”  
}  
\</script\>

\<table\>  
\<tr id=“colorback1”\>  
\<td\>\<input name=“test” type=“radio” onClick=“clearAll();colorback1.className=‘bgwhitesmoke’” value=“1”\>\</td\>  
\<td\>name 1\</td\>  
\<td\>110-29172\</td\>  
\</tr\>  
\<tr id=“colorback2”\>  
\<td\>\<input name=“test” type=“radio” onClick=“clearAll();colorback2.className” value=“2”\>\</td\>  
\<td\>name 2\</td\>  
\<td\>110-29172\</td\>  
\</tr\>  
\</table\>

And one thing, do u guys have an yahoo account??? they use checkboxes, how can i do it with radio buttons.

TNX GUYS!!!
