TOC PREV NEXT INDEX

Put your logo here!


style


style returns the block of style rules on the current element.

Syntax

styleBlock = element.style  
( element.style.styleAttr = value ) 

Parameters

styleBlock is a string containing the

Example

div = document.getElementById("div1); 
div.style.marginTop = ".25in"; 

Notes

style is a very commonly used property in DOM programming. You can use it to get the style rules associated with a particular element, and though you cannot set style on an element by assigning to the style property directly, you can use the style property to get to the writable style attributes on the node, as in the short example above.

See the DOM CSS Properties List for a list of the CSS properties that are accessible from the Gecko DOM.

Specification

link to DOM spec here


mozilla.org | mailto:oeschger | bug 93108
TOC PREV NEXT INDEX