This is supposed to change the position of a paragraph (with the id \'Text\') more to the right each time it is looped. It doesn\'t work though and I can\'t figure out how to fi
try this one
d
have not any value so define d
with
d = document.getElementById('Text');
and call your function myLoop
so its work
var x = 0;
d = document.getElementById('Text');
d.style.position = "absolute";
myLoop();
function myLoop() {
setTimeout(function() {
x += 10;
d.style.left = x + 'px';
myLoop();
}, 100)
}