After implementing the script below, I successfully managed to shift my image to the right upon clicking:
<script>
var myTimer = null;
function move(){
document.getElementById("fish").style.left =
parseInt(document.getElementById("fish").style.left)+1+'px';
}
window.onload=function(){
document.getElementById("fish").onclick=function(){
if(myTimer == null){
myTimer = setInterval("move();", 10);
}else{
clearInterval(myTimer);
myTimer = null;
}
}
}
</script>
I am facing difficulty in reverting the picture to its original position without relying on jQuery.
Your assistance with this matter would be greatly appreciated.