Animating multiple canvas

I have multiple canvas element which has frames of images.
code:

for (let i = 0; i < frames.length; i++) 
    document.body.appendChild(frames[i].getImage());

will give the result :

How do I animate this?