Привет, я делаю учебник, и текст «Yoo» предполагает движение вправо, но это не так. TyПеремещение текста с помощью setTimeout в Javascript не работает
<!DOCTYPE html>
<html>
<head>
<script>
var timer, x_pos=0, txt;
function _timer() {
txt = document.getElementById("txt");
x_pos = x_pos+1;
txt.style.left = x;
timer = setTimeout(_timer, 50);
}
</script>
</head>
<body onload="_timer()">
<h1 id="txt" style="position:absolute; left:0"> Yooo </h1>
</body>
</html>
изменение txt.style.left = х; to txt.style.left = x_pos; – harry