<html>
<head>
<style>
#myDIV {
background-color: lightblue;
}
</style>
</head>
<body>
<h1>Change margin-left with JavaScript</h1>
<p>Click the "Try it" button to change the left margin of the DIV element:</p>
<button onclick="myFunction()">Try it</button>
<div id="myDIV">
This is my DIV element.
</div>
<script>
function myFunction() {
document.getElementById("myDIV").style.marginLeft = "100px";
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/cssref/tryit.asp?filename=trycss_js_margin-left by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:01:19 GMT -->
</html>