usban
03-24-2004, 10:58 PM
I want to be able to take the background-color of a determined cell
<table id="fondo" width="25px" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#454545">
<tr>
<td> </td>
</tr>
</table>
the when i press a button i want to be able to catch tha #454545, i get it in iexplorer but i cannot do it with netscape.
function muestra() {
var id2 = "fondo";
var obj2 = document.getElementById ? document.getElementById(id2) : document.all ? document.all(id2) : null;
alert(obj2.style.bgcolor);
}
I've tried qith bgcolor, background, color, ... but i only get "undefined" or even something like "4545px 50%" wich has no sense for me :confused:
<table id="fondo" width="25px" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#454545">
<tr>
<td> </td>
</tr>
</table>
the when i press a button i want to be able to catch tha #454545, i get it in iexplorer but i cannot do it with netscape.
function muestra() {
var id2 = "fondo";
var obj2 = document.getElementById ? document.getElementById(id2) : document.all ? document.all(id2) : null;
alert(obj2.style.bgcolor);
}
I've tried qith bgcolor, background, color, ... but i only get "undefined" or even something like "4545px 50%" wich has no sense for me :confused: