Answers for "js add margin with variable"

0

js add margin with variable

var players = document.getElementsByClassName('player');
for(var i = 0; i < players.length; i++)
    players[i].style.marginTop = playerPosition+"px";
Posted by: Guest on January-19-2021
0

js add margin with variable

document.getElementsByClassName('player')[0].style.marginTop = playerPosition+"px";
Posted by: Guest on January-19-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language