Move object using javascript - Web Development

Move object using javascript = ‘0px’; It is used to set object at left side with zero px . = ‘100px’; If you set 100px; then it will leave 100px from left side

imgObj = document.getElementById(‘img’); imgObj is a variable and storing img id ( id = “img”)

function moveRight()
{ = parseInt( + 100 + ‘px’;
} // I Called this function to onClick event of input button

If you run this code

JavaScript Move right left Animation

Click button below to move the image to right

Leave a Reply

Your email address will not be published. Required fields are marked *