View Single Post
Skilled contributor
1Apr2009,15:22  
Bhullarz's Avatar
here is the code:
Code:
<head>
<script type="text/javascript">
function setpad()
	{alert(document.getElementById("complete").style.margin-left);}
</script>
<style type="text/css">
#complete{
margin-left:180px;}
</style>
</head>
<body onload="setpad();">
<div id="complete">
text data
</div>
</body>
I am unable to access property of div "complete" ie. margin-left. What could be the other way to change it?
I a getting the error that "left is undefined".