I want to create 3 images in different y positon however doing this code it shows the position changed in devtools but not in the browser

<body>

    <div class="img">

        <!-- <img src="../tree-vector.webp" alt=""> -->

    </div>

    <div id="road" class="mainRoad">
    </div>

<script>
let numTimes = 5;

    let tree = document.querySelector(".img");

for(let i = 0; i < numTimes; i+=2){

    let tr = tree.getBoundingClientRect();

    console.log(tr);

    tree.y = (50* i);

    console.log(tree.y);
}
</script>