元素位移只能移动一次

请问,有什么办法能做出点击那个“去注册”然后可以让这个登录板块向右移动,然后再自己向左回到原位呢?

img


<!doctype html>
<html lang="en" class="to-trol to-begin">
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <style>
        body {
            padding: 200px;
        }
        #move {
            transition: transform 2s;
        }
    </style>
</head>
<body>
    <div id="move">move</div>
    <button id="btn">go</button>
</body>
<script>
    var btn = document.getElementById('btn')
    btn.addEventListener('click', function () {
        var move = document.getElementById('move')
        move.style.transform = 'translateX(-100px)'
        setTimeout(() => {
            move.style.transform = 'translateX(0px)'
        }, 2000); // 这里是2000ms跟随样式上面定义的transition中的时间一致
    })
</script>
</html>