We would like to know how to move element position.
<!DOCTYPE html>
<html>
<body>
<a id="button">Click me to move down the div</a>
<div id="player" style="position: absolute;">player</div>
<script type='text/javascript'>
<!-- w w w. j a v a 2 s . c o m-->
var player = document.getElementById("player");
var button = document.getElementById("button");
function moveDown(object) {
object.style.top = parseInt(object.style.top || 0) + 32 + 'px';
}
button.onclick = function() {
moveDown(player);
}
</script>
</body>
</html>
The code above is rendered as follows: