One thing that stands out is why does document.getElementsById function as expected here
<div id="move">add padding</div>
<button type="button" onclick="movefun()">pad</button>
<script>
function movefun() {
document.getElementById("move").style.paddingLeft = "50px";
}
</script>
while document.getElementsByClassName fails to deliver the desired outcome
<div class="move">add padding</div>
<button type="button" onclick="movefun()">Set left padding</button>
<script>
function movefun() {
document.getElementsByClassName("move").style.paddingLeft = "50px";
}
</script>
We have omitted common elements like the html and body tags to maintain code brevity.