dojo.getComputedStyle
<script src="../../js/dojo.js"></script>
defined in dojo/_base/html.js
Gets a "computed style" object which can be used to gather information about the current state of the rendered node.
Note that this may behave differently on different browsers. Values may have different formats and value encodings across browsers.
Note also that this method is expensive. Wherever possible, reuse the returned object.
Use the dojo.style() method for more consistent (pixelized) return values.
Usage
function (/*DOMNode*/ node) (view source)
parameter | type | description |
---|---|---|
node | DOMNode | A reference to a DOM node. Does NOT support taking an ID string for speed reasons. |
Examples
Example 1
dojo.getComputedStyle(dojo.byId('foo')).borderWidth;