# DOM style object - borders?

**URL:** <https://forum.kirupa.com/t/dom-style-object-borders/240843>\
**Category:** web dev\
**Created:** [October 7, 2007, 5:13am UTC](https://forum.kirupa.com/t/dom-style-object-borders/240843 "2007-10-07T05:13:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthewjumps](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@matthewjumps](https://forum.kirupa.com/u/matthewjumps)\
**Post date:** [October 7, 2007, 5:13am UTC](https://forum.kirupa.com/t/dom-style-object-borders/240843/1 "2007-10-07T05:13:23Z")

</div>

im using this javascript function

```auto

function getStyle(el, styleProp) {
    var y;
    if (el.currentStyle) {
        y = el.currentStyle[styleProp];
    } else if (window.getComputedStyle) {
        var style = window.getComputedStyle(el, null);
        y = style[styleProp];
    }
    return y;
}

```

to get properties of any object that has styling applied in external stylesheets…and it works fine.

for instance, getStyles(source, “marginTop”); works perfectly…i can access any CSS property like this

BUT: why the hell doesnt getStyles(source, “borderTop”); or any other border-related properties return? any element i have that has borders defined on it, if i run my javascript function on it to check its borders, it returns nothing (undefined in IE)?

is this a bug? do borders not exist? whats going on?
