Get DOM elements inside a rectangle area of a page
<p>Given two points on a webpage and a set of DOM elements, how to find out the subset of those DOM elements that sit inside the rectangle area defined by the two points?</p>

<p>I am working on a web-based gallery, in which every photo is wrapped in a <code>li</code> tag. When a user drag out a rectangle area with mouse, all <code>li</code> elements inside the rectangle are marked as selected.</p>

<p>Prefer a jQuery solution for less wordy and an efficient way.</p>
