how to give value of margin in js code example
Example: js add margin with variable
var players = document.getElementsByClassName('player');
for(var i = 0; i < players.length; i++)
players[i].style.marginTop = playerPosition+"px";
var players = document.getElementsByClassName('player');
for(var i = 0; i < players.length; i++)
players[i].style.marginTop = playerPosition+"px";