I’m building a web browser game.
Using Jquery 1.4 as framework
But i need to delete the trees that are in the building area.
This is what happens now:

I would like to delete the trees if they are in the image area.
Made some sample code for show: http://jsfiddle.net/coolking/evU9D/3/
I hope i’ve given enough info.
Image height: 73px image width: 107px
The code incorporating the accepted answer is here: http://jsfiddle.net/coolking/evU9D/22/
Quick aside: it’s better practice to apply all of your event listeners in JavaScript via element.AddEventListener() than to add HTML attributes like onload=”…” or onmousedown=”…”.
jQuery has collision detection APIs to determine exactly what you’re asking. Here’s a good reference: jQuery/JavaScript collision detection
When you detect a collision, use something along the lines of $(this).remove() to remove the tree from the DOM.
I love strategy games, so I hope your game turns out well! =D