How to set marginLeft property using JavaScript?
<p>I used the following code to set the left margin for a div with <code>id=""</code></p>

<pre><code>document.getElementById('s4-ca').style.marginLeft = '0px';
</code></pre>

<p>However getting an error like Object Required!</p>

<p>UPDATE - My code</p>

<pre><code>&lt;script type="text/javascript"&gt;
    var groupName;
    $().SPServices({
    operation: "GetGroupCollectionFromUser",
    userLoginName: $().SPServices.SPGetCurrentUser(),
    async: false,
    completefunc: function(xData, Status) {
    $(xData.responseXML).find("[nodeName=Group]").each(function()
    {
    groupName = $(this).attr("Name");
    });
    }
    });
    if($.trim(groupName) != 'ABC')
    {
    document.getElementById('s4-leftpanel').style.display = 'none';
    document.getElementById('s4-ca').style.marginLeft = '0px';
    }
&lt;/Script&gt;
</code></pre>
