add margin with js code example
Example: js add margin with variable
document.getElementsByClassName('player')[0].style.marginTop = playerPosition+"px";
document.getElementsByClassName('player')[0].style.marginTop = playerPosition+"px";