Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<head>
<style> 
#myDIV {
  border: 1px solid black;
  background-color: lightblue;
}
</style>
</head>
<body>
<h1>Change padding-left with JavaScript</h1>
<p>Click the "Try it" button to change the padding-left property of the DIV element:</p>
<button onclick="myFunction()">Try it</button>
<div id="myDIV">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat...
</div>
<script>
function myFunction() {
  document.getElementById("myDIV").style.paddingLeft = "50px";
}
</script>
</body>
</html>