segundo código
Código Javascript
:
Ver original<html>
<head>
<title>Computed Style Example</title>
<style type="text/css">
div.special {
background-color: red;
margin: 10px;
background-position: 0 -30px;
}
</style>
<script type="text/javascript">
function getBackgroundColor() {
var oDiv = document.getElementById("div1");
alert(oDiv.currentStyle.margin);
}
</script>
</head>
<body>
<div id="div1" class="special">para explorer</div>
<input type="button" value="Get Background Color" onclick="getBackgroundColor()" />
</body>
</html>