I have a simple code with CSS3 translate() which should be triggered by Javascript. But it does not animate the translation it immediately jumps to the position. If I use css :hover it works as expected. But not with JS. What am I doing wrong? Here is JSFiddle example https://jsfiddle.net/umkrt5b1/ Here is the code:
<style>
    #test {
        transition: transform 1000ms linear;
        background-color: green;
        display: inline-block;
        width: 50px;
        height: 50px;
    }
</style>
<div id="test"></div>
<script>
    document.getElementById('test').style.transform = 'translateX(200px)';
</script>
 
    