Hello,
Anyone know how to use object Style in NS 4.x and how to access the
properties of it? If you can, please give me an example.
I have a table, in which, I use style sheet to format a table row:
<html>
<head>
<style type="text/css">
.trStyle1 {background-color: #FFFF00;}
.trStyle2 {background-color: #FCFCD6;}
</style>
</head>
<body>
<table width=100 border=1 cellspacing=0 cellpadding=0>
<tr class="trStyle1">
<td>Some information here......</td>
</tr>
</table>
</body>
</html>
Can I change the style of TR from "trStyle1" to "trStyle2" on NS 4.x? Or any
way to change new properties (example background color) of TR?
I don't want to use document.write("<table width=100 border=1 cellspacing=0 cellpadding=0>" +
" <tr class="trStyle2">"+
" <td>Some information here......</td>"+
" </tr>"+
" </table>");
to change TR's properties.
I use document.classes to create Style object like that:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<style type="text/javascript">
classes.GreenBody.all.backgroundColor="green"
</style>
<script>
function load() {
alert(document.classes.GreenBody.all.backgroundColor);
document.classes.GreenBody.all.backgroundColor="cyan";
alert(document.classes.GreenBody.all.backgroundColor);
}
</script>
<body bgcolor="#FFFFFF" text="#000000" onLoad="load()">
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr class="GreenBody">
<td>Hehehehe</td>
</tr>
</table>
</body>
</html>
The default background color of TR is green. I want after loading, change
it's color from GREEN to BLUE. It seems that the background color is
changed, but on browers, nothing happens.
Thanks for help,
Tuy Le
Anyone know how to use object Style in NS 4.x and how to access the
properties of it? If you can, please give me an example.
I have a table, in which, I use style sheet to format a table row:
<html>
<head>
<style type="text/css">
.trStyle1 {background-color: #FFFF00;}
.trStyle2 {background-color: #FCFCD6;}
</style>
</head>
<body>
<table width=100 border=1 cellspacing=0 cellpadding=0>
<tr class="trStyle1">
<td>Some information here......</td>
</tr>
</table>
</body>
</html>
Can I change the style of TR from "trStyle1" to "trStyle2" on NS 4.x? Or any
way to change new properties (example background color) of TR?
I don't want to use document.write("<table width=100 border=1 cellspacing=0 cellpadding=0>" +
" <tr class="trStyle2">"+
" <td>Some information here......</td>"+
" </tr>"+
" </table>");
to change TR's properties.
I use document.classes to create Style object like that:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<style type="text/javascript">
classes.GreenBody.all.backgroundColor="green"
</style>
<script>
function load() {
alert(document.classes.GreenBody.all.backgroundColor);
document.classes.GreenBody.all.backgroundColor="cyan";
alert(document.classes.GreenBody.all.backgroundColor);
}
</script>
<body bgcolor="#FFFFFF" text="#000000" onLoad="load()">
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr class="GreenBody">
<td>Hehehehe</td>
</tr>
</table>
</body>
</html>
The default background color of TR is green. I want after loading, change
it's color from GREEN to BLUE. It seems that the background color is
changed, but on browers, nothing happens.
Thanks for help,
Tuy Le
Comment