<!DOCTYPE html>
<html>
<head>
<style>
#myDiv {
    border: 1px solid #FF0000;
}

</style>
</head>
<body>

<div id="myDiv">This is a div.</div>
<br>
<button type="button" onclick="myFunction()">Set left padding</button>

<script>
function myFunction() {
    document.getElementById("myDiv").style.paddingLeft = "50px";
}
</script>

</body>
</html>