Click to See Complete Forum and Search --> : attibutes of a div statement


ngungo
03-04-2003, 11:19 PM
Suppose I have a div statement:

<div id="quote" align="center" style="font-family:Arial; font-size=14; color=#0000cc; style=visibility:hidden; height:9"></div>

0. How do I change its "attributes." For example:

div.align = "right"; // or
div.font-size = 12;

As a matter of fact I need to change the font color. Something like:

div.color = #0000dd;


1. In case I can change the font color, how do I change by an arithmatic manner like:

div.color = div.color + #000011;



Thanks in advance,
ngungo

khalidali63
03-05-2003, 06:15 AM
You can do this by using DOM object referencing,

var obj = document.getElementById("divId")
obj.setAttribute("style","color:red;");

Cheers

Khalid