Change the left margin of a <div> element back to "normal":
document.getElementById("myDiv").style.marginLeft = "0px";
<!DOCTYPE html> <html> <head> <style> #myDiv {//from w ww . j a va 2s . c om border: 1px solid #FF0000; margin-left: 75px; } </style> </head> <body> <div id="myDiv">This is a div.</div> <br> <button type="button" onclick="myFunction()">Change left margin</button> <script> function myFunction() { document.getElementById("myDiv").style.marginLeft = "0px"; } </script> </body> </html>