The result of a getComputedStyle contains a property named \"margin\", but the property is always an empty string (\"\") in Mozilla Firefox or Appl
var elem = document.getElementById("your-div");
if (elem.currentStyle) {
var margin = elem.currentStyle.margin;
} else if (window.getComputedStyle) {
var margin = window.getComputedStyle(elem, null).getPropertyValue("margin");
}
alert(margin);
you can use this shim,works for all browsers:refer this
use currentStyle for Internet Explorer.
use getComputedStyle for other browsers