<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>test</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<script type="text/javascript">
function move () {
x = document.getElementById("id1").offsetLeft;
xn = x + 50;
document.getElementById("id1").style.left = xn+"px"
}
</script>
<input type="button" value="Replace content" onclick="move()">
<img id='id1' src="res\img.png" style="position: relative;">
</body>
</html>
transition: left 0.3s linear