Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

layer style

Status
Not open for further replies.

fuli42

Technical User
Jul 9, 2002
74
HU
How do you change a layer's style? Not only its backgroundColor, but its style.border, etc?
Somehow it doesn't work on my IE6 (style is null or not an object).
Thank you
 
Here it is:

function layerStyle(element) {
document.getElementById(element).style.color = "green";
document.getElementById(element).style.borderStyle = "dotted";
document.getElementById(element).style.borderWidth = "2"
}

Call it like this:
<div id=&quot;one&quot;>
<a href=&quot;javascript:layerStyle('one')&quot;>change style</a>
block content
</div>

This works everywhere except NN4.x.
Go to and check &quot;Object CSS2Properties > The CSS2Properties object has the following properties:&quot; for the list of style properties you can use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top