JSFiddle - React, Tailwind, and code Playground

by mowglisanu

CSS

body{
    margin:8px 10px 8px 10px;
}

JavaScript

function getStyle(el,styleProp)
{
    if (el.currentStyle)
        var y = el.currentStyle[styleProp];
    else if (document.defaultView && document.defaultView.getComputedStyle)
        var y = document.defaultView.getComputedStyle(el,null).getPropertyValue(styleProp);
    return y;
}
alert(getStyle(document.body,'margin'));