<!DOCTYPE html>
<html>
<head>
<style type="text/css">
#div-id {
position:absolute;
}
</style>
</head>
<body>
<script>
var divid = null;
function move(count)
{
divid.style.left = parseInt(divid.style.left) + 1 + 'px';
if (count > 200)
return;
setTimeout(function() {move(count + 1);}, 10); // Recursive setTimeout call move every 10msec
}
function init()
{
divid = document.getElementById('div-id');
divid.style.left = '0px';
move(1); // start animating
}
window.onload = init;
/*
run:
Move the text "Hi" 200 pixels to the right
*/
</script>
<div id="div-id">Hi</div>
</body>
</html>