You guys would have seen the image cropping tool which has a selection option (marque tool) created in javascript.
Like this i want to get all elements under a selection.

For example in windows we have mouse group selection of files and folders by dragging the mouse to select multiple files. Like that i need to get all the elements under a selection in javascript. I can try other gimmicks but if there could be a simple tool then i can speed up my work.