How to check image collision in js?

I already made an image follow the mouse, but how can I check it?
I'm making a minecraft pickaxe brake a cobblestone (that's for my friend's bday)
Was this page helpful?