Answers for "set element position js"

1

set element position js

<button id="btn" onclick="move()">
    I move!
</button>

<script>
    function move(){
        document.getElementById("btn").style.position="relative";
        document.getElementById("btn").style.top="500px";
        document.getElementById("btn").style.left="500px";
    }
</script>
Posted by: Guest on August-30-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language