dcsimg
changing color in table cell using javascript.
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Abdul_Ambalam
Posted On:   Tuesday, December 11, 2001 03:49 AM

hi,

I have a table with some rows and each rows contain a check box and some data.
when I click the checkbox in a row, the bgcolor of the row should be changed. how to do this in Javascript.

Re: changing color in table cell using javascript.

Posted By:   yasin_yasin  
Posted On:   Wednesday, December 12, 2001 02:27 AM

The code given by Sujatha, wont work in Netscape.
For that u have to identify the Netscape browser and use Layers for that


function TableColor_Change(i)

{(
if (document.layers)
window.document.layers['id' + i].bgColor = red;
else if (document.all)
window.document.all['id' + i].style.background = color;
}


document.all for IE

and document.layers for Netscape!.
I think so this,...can work in both the browsers

Re: changing color in table cell using javascript.

Posted By:   Sujatha_Gopal  
Posted On:   Tuesday, December 11, 2001 10:10 PM

Try this.Works in IE only














(TABLE)


(TR id=tr1)


(TD)(/TD)


(TD)A(/TD)


(TD)B(/TD)


(TD)C(/TD)


(/TR)


(/TABLE)







About | Sitemap | Contact